I have a popup/infowindow that returns info for 2 of the layers in my map
Is there a way to disable this so that the popup only appears when a feature is clicked?
var removalTemplate = new esri.InfoTemplate(); removalTemplate.setContent('<table cellspacing=\"5\" style=\"font-size:90%\"><tr><td style=\"vertical-align:top\"><b>Road Name:</b></td><td style=\"vertical-align:top\">${Name}</td></tr><tr><td style=\"vertical-align:top\"><b>Snow Removal Priority:</b></td><td style=\"vertical-align:top\">${Priority:formatPriorityLabel}</td></tr></table>'); removalTemplate.setTitle('${Name}');
// Define the Snow Removal Route layer theSnowRemovalLayer = new esri.layers.FeatureLayer("URL to feature layer", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate:removalTemplate, outFields: ["*"], opacity:0.80, visible: false });
dojo.connect(theSnowRemovalLayer,"onClick",function(evt){ //Listener event for feature selection and the popup info widow var query = new esri.tasks.Query(); query.geometry = pointToExtent(map,evt.mapPoint,15); var deferred = theSnowRemovalLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW); map.infoWindow.resize(map.width * 0.55,map.height * 0.25); map.infoWindow.setFeatures([deferred]); map.infoWindow.show(evt.mapPoint); });
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.