I am having trouble getting the correct lat/long coordinates to show up on my map. I have coordinates showing up but they do not reset when they hit 180 or -180. It keeps going on onto 190..191..etc and -182...-190...etc. I keep getting a "Uncaught TypeError: Cannot read property 'clone' of undefined at Object.f. webMercatorToGeographic... Here is code I'm using:
// Create a Map, add the basemapMap to the Map:
var map = new Map({
basemap: basemapMap,
center: [0, 0],
slider: false,
layers: []
});
// Add the Map to the MapView:
var view = new MapView({
....
});
view.on("pointer-move", function(evt){
var coordinates = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);
dom.byId("info").innerHTML = coordinates.x.toFixed(5) + ", " + coordinates.y.toFixed(5);
});
Mansi,
Sounds like you need to normalize the point:
https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#normalize