Problem with popups and points in a graphic layer

المشرف العام

Administrator
طاقم الإدارة
I have a graphic layer with two points on a graphic layer, zoomed out such that they overlap. I have a Popup as the info window for the map with paging controls enabled.

My expectation is that when I click on the point, I would get 2 in the paging control. But I cannot get it to work, I just get the popup for the clicked point, without the paging for the other point.

I would appreciate any feedback. Below is the code

var map;

require([ "esri/InfoTemplate", "esri/dijit/Popup", "esri/dijit/PopupTemplate", "esri/map", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/tasks/query", "esri/toolbars/draw", "dojo/dom", "dojo/on", "dojo/parser", "dojo/_base/array", "esri/Color", "dijit/form/Button", "dojo/domReady!", 'esri/symbols/SimpleMarkerSymbol' ], function ( InfoTemplate, Popup,PopupTemplate,Map,SimpleFillSymbol, SimpleLineSymbol, Query, Draw, dom, on, parser, arrayUtil, Color ) { parser.parse(); map = new Map("map", { basemap: "streets", zoom: 5, center:[151.22,-33.8] }); function getPopupTitle(obj){ if (obj.fetchTitle) { return obj.fetchTitle; }else{ return 'default title from func'; } } function getPopupContent(){ return 'content from func'; } var gt = new esri.InfoTemplate(); gt.setTitle(getPopupTitle); gt.setContent(getPopupContent); var popupOptions = { marginLeft: "20", marginTop: "20" }; var popup = new esri.dijit.Popup(popupOptions, dojo.create('div')); popup.pagingControls = true; popup.startup(); map.setInfoWindow(popup); map.on('load',function() { var symbol = new esri.symbol.SimpleMarkerSymbol(); symbol.setPath("M16,3.5c-4.142,0-7.5,3.358-7.5,7.5c0,4.143,7.5,18.121,7.5,18.121S23.5,15.143,23.5,11C23.5,6.858,20.143,3.5,16,3.5z M16,14.584c-1.979,0-3.584-1.604-3.584-3.584S14.021,7.416,16,7.416S19.584,9.021,19.584,11S17.979,14.584,16,14.584z"); symbol.setSize(20); symbol.setOffset(0,18); var marker = new esri.Graphic(new esri.geometry.Point(151.22,-33.8),symbol); map.graphics.setInfoTemplate(gt); map.graphics.add(marker); var marker = new esri.Graphic(new esri.geometry.Point(151.23,-33.8),symbol); map.graphics.add(marker); marker.fetchTitle = 'custom title'; }); });



أكثر...
 
أعلى