Select to view content in your preferred language

Extent/InitialExtent Behavior

686
2
04-11-2010 08:49 AM
LanceCrumbliss
Occasional Contributor II
hi all,

what is the easiest way to set the extent of MyMap (that has a set SpatialReference due to MyMap.Layers(0) being a Bing.TileLayer) to the InitialExtent of an ArcGISDynamicMapServiceLayer contained within it (say, MyMap.Layers(1) for example) that has a different SpatialReference?  I was hoping that

MyMap.Extent = (dynamicServiceLayer.InitialExtent)


would take into account and SpatialReference conversions necessary, but that's not the case (understandable, since it's all client-side code.  still, i could hope...). 

will i need to create a new Envelope and do the conversions using a GeometryService or am i missing something?

lance
0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor
Yes you will need to use a GeometryService to project the envelope.
You could write the projection logic yourself on the client, which for Mercator is pretty simple. It's even simpler if your data is in WGS84 geographic coordinates (epsg:4326). In that case you can just use the ESRI.ArcGIS.Client.Bing.Transform classes.
0 Kudos
LanceCrumbliss
Occasional Contributor II
Yes you will need to use a GeometryService to project the envelope.
You could write the projection logic yourself on the client, which for Mercator is pretty simple. It's even simpler if your data is in WGS84 geographic coordinates (epsg:4326). In that case you can just use the ESRI.ArcGIS.Client.Bing.Transform classes.


thanks morten.  on a related note, what if the layer has a custom projection (WKID=0) defined?  maybe use the SOAP API for that?
0 Kudos