I add bing map layer on run time in my application as a base map.in my application i want t0 add new point of interest in my extent.whenever i add the point it add the point outside from my extent.as per my information i think it is due to bing map layer.please help me how to solve this problem.
code is given below.
Before i was doing like this
pt = new Point(txtLong, txtLat, map.spatialReference);
i changed it with below line.
pt = new Point(txtLong, txtLat, new SpatialReference({ wkid: 4326 }));
but i found same result always in both statments. Point is always outside from my area of extent.
Please help.
Solved! Go to Solution.
Nadir,
Bing Basemap use the WKID of 102100 not 4326 so you need to take your points in 4326 and use WebMercatorUtils to project them to web mercator.
"esri/geometry/webMercatorUtils" pt = new Point(txtLong, txtLat, new SpatialReference({ wkid: 4326 })); var geom = webMercatorUtils.geographicToWebMercator(pt);
Nadir,
Bing Basemap use the WKID of 102100 not 4326 so you need to take your points in 4326 and use WebMercatorUtils to project them to web mercator.
"esri/geometry/webMercatorUtils" pt = new Point(txtLong, txtLat, new SpatialReference({ wkid: 4326 })); var geom = webMercatorUtils.geographicToWebMercator(pt);