AnsweredAssumed Answered

URL Parameters Sample (Polygons vs. Points)

Question asked by Kentucky_DGI on Jun 5, 2012
Latest reply on Jun 6, 2012 by akpaga
We've been working with this sample and are having some issues using it with Point data rather than the Polygon data that is leveraged in the sample. When we change the code to use a point based data source we are able to get it to place a PictureMarkerSymbol at the selected point's location, however the popup window does not appear and it does not re-center the map as it does with the Resource Center Sample.

Below are links to our two versions:

I suspect my issue is somewhere within this function but I may be totally off base:

//when users click on the map select the parcel using the map point and update the url parameter         dojo.connect(map, 'onClick', function (e) {           var query = new esri.tasks.Query();           query.geometry = e.mapPoint;           var deferred = sites.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (selection) {             //update the url param if a parcel was located             if (selection.length > 0) {               var entityid = selection[0].attributes['OBJECTID'];               //Refresh the URL with the currently selected parcel               if (typeof history.pushState !== 'undefined') {                 window.history.pushState(null, null, "?entityid=" + selection[0].attributes.OBJECTID);               }             }           });           map.infoWindow.setFeatures([deferred]); ;          });

Please let us know if you've run into this previously or have any ideas on how to resolve the issue.

Thanks so much!