I am adding a layer programatically and I am trying to zoom to that layer. However the service that I am adding is in a different spatial reference than my map. Is there still a way to zoom to that layer when it is added to the map?
Even if spatial reference of the later service is different, it would be re projected on the fly to the spatial reference of the map.So,there should not be any issue.
1. Create new envelope. 2. Use xMin,xMax,yMin and yMax of the LaterService::FullExtent to set the coordinates of this envelope. 3. Use spatial referene of the map to set Envelope::SpatialReference 4. Set extent.
It is a DynamicMapServiceLayer map service layer that is a different spatial reference than the map. I am trying to zoom to the layer in the map inside of the initialized event of the loaded layer.