Bing coordinate system

1183
1
09-10-2010 08:22 AM
RebeccaMaaser
New Contributor
I'm not very familiar with the various coordinate systems that are out there, but I have regular latitude & longitude values (in decimal format) that I'm trying to plot on various base maps using the javascript API. For most of the maps, it works fine if I use a SpatialReference specified as { wkid: 4326 } for my Point objects. However, when I use Bing as my base map (i.e. the only layer in my map is a VETiledLayer instance), the map always seems to use a SpatialReference with wkid 102100. Even if I change the spatialReference property of the map and use { wkid: 4326 } in my Point objects, I cannot get it to use the coordinate system I want. All of my lat/long points get plotted near Africa (at [0,0] in lat/long), whereas if I use x/y values in the millions, I can actually get the points in different parts of the map.

How can I plot regular latitude / longitude values on a Bing map?

Thanks,
Rebecca
0 Kudos
1 Reply
derekswingley1
Frequent Contributor
This is a common conversion and the API provides a utility function to take care of it for you:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#geographicToWeb...

Pass the function an esri.geometry.Point constructed from your lat/lng and you'll get back a point you can plot on bing (or arcgis.com services...).
0 Kudos