map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
Are you using something like this to show your info window:map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
function createMap() { try { //instantiate the map and add layers etc Utils.mapAndBaseLayer(CWLSettings.cityExtent); dojo.connect(map, "onLoad", function() {dojo.connect(map, "onClick", executeQueryTask);}); dojo.connect(map.infoWindow, "onHide", function() {map.graphics.clear();}); queryTask = new esri.tasks.QueryTask(cwlService.Url + '/' + shapeLayerID); query = new esri.tasks.Query(); query.returnGeometry = true; query.outFields = ["NAME", "LAYER"]; } catch (ex) { console.log(ex); } } function executeQueryTask(evt) { map.infoWindow.hide(); map.graphics.clear(); featureSet = null; query.geometry = evt.mapPoint; //Execute task and call showResults on completion queryTask.execute(query, function(fset) { if (fset.features.length === 1) { showFeature(fset.features[0],evt); } else if (fset.features.length !== 0) { showFeatureSet(fset,evt); } }); } function showFeature(feature,evt) { map.graphics.clear(); var symbol = ... //simple marker symbol feature.setSymbol(symbol); var attr = feature.attributes; var title = attr.NAME ? attr.NAME : attr.LAYER; var content = title; map.graphics.add(feature); map.infoWindow.setTitle(title); map.infoWindow.setContent(content); (evt) ? map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)) : null; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.