Hi,
Might need a little more information. You received output but the "result was wrong"? What projection are you using? Did you set the spatialreference for the desired coordinate output?
Thanks,
Luci
require([ "esri/map", "esri/geometry/webMercatorUtils", "dojo/domReady!" ], function ( Map, webMercatorUtils ) { map = new Map("map", { basemap: "satellite", center: [-46.807, 32.553], zoom: 3 }); function getCenterPoint() { return map.extent.getCenter(); } map.on("extent-change", function () { var point = getCenterPoint(); var newPoint = webMercatorUtils.webMercatorToGeographic(point); console.log("current map center is x: " + newPoint.x + ", y: " + newPoint.y); }); });
map.extent.getCenter().getLatitude(); map.extent.getCenter().getLongitude();in a web mercator map.
Hi, Ken Buja
Good to hear from you! Actually I would like to click the check mark, but the problem is that I couldn't find where the check mark is? Any help?
In the new forums, the procedure to mark a question as the answer has been changed. Normally, it should be clear how to mark a question as answered in the new forums. However, this thread was begun in the old forum, and when it was brought over to the new forum, it was classified a discussion and not a question, which means it doesn't have the option to mark it as answered. Hopefully this will be changed soon as they continue to work on the migration process.
Hi Ken Buja Thanks for you reply for me. As you said that means I wasn't able to mark it as answered right now. so I don't need to mark it at the moment, right?