AnsweredAssumed Answered

How do I click a map dynamically.

Question asked by muralidhar.moka on Apr 15, 2019
Latest reply on Apr 16, 2019 by muralidhar.moka

Hi,

 

Here is a method which will querying for a point. 

QueryTask returns the point and then we add the point to the map.

I would like to dynamically click at the point location.

How can I do that.

 

 

showFacilityGeometry :function(facilityId){

  var queryTask = new QueryTask("http://mapviewtest.memphistn.gov/arcgis/rest/services/AGO_GeneralServices/PMS_WOMS/MapServer/1");
var query = new Query();
query.where = "FACILITY_ID='" + facilityId + "'";
query.outFields=['*'];
query.returnGeometry = true;
this.map.graphics.clear();

queryTask.execute(query).then(lang.hitch(this,function(feature){

//Here I get a point geometry and we create symbol for that point.
var geometry = feature.features[0].geometry;
var pointSymbol = new SimpleMarkerSymbol();
pointSymbol.setColor(new Color([255, 255, 0, 0.5]));

//create graphic and add graphic
var graphic = new Graphic(geometry, pointSymbol);
this.map.graphics.add(graphic);

//Here I want to dynamically click the map at the above point??? How to do this?

//zoom to the point geometry. added padding to the extension
var PointExtent = new Extent(geometry.x - 250, geometry.y - 250, geometry.x + 250, geometry.y + 250);
PointExtent.spatialReference = new SpatialReference({ wkid: 102736 });
this.map.setExtent(PointExtent);
}));

},

Outcomes