Select to view content in your preferred language

Bing Map Projection

2424
1
Jump to solution
03-05-2016 01:23 AM
NadirHussain
Frequent Contributor


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.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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);

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Emeritus

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);