I am using Arcgis javascript API for my map where map is coming from arcgis online using map by ID.
Now I want to set map center using Lat long,For this I am using this method to set map center
map.centerAt(42.58,78.25);
But this method is not working for me.
Does anybody know how to set map center using Lat Long In Arcgis javascript API.
Best Answer
the centerAt() method expects a point geometry object.
this is mentioned in the API reference: https://developers.arcgis.com/javascript/jsapi/map-amd.html#centerat
the object can be constructed using WGS84 coordinates without specifying a spatial reference, but it doesn't hurt anything to include it.
https://developers.arcgis.com/javascript/jsapi/point-amd.html