Zoom inside the loaded Dynamic Map when Location Service is OFF

3892
2
07-07-2015 12:23 PM
GajaNaik
New Contributor III

I have dynamic MAP loaded on Blank Map or Tiled MAP.

i need to Zoom in to Dynamic MAP when Location Service is OFF or when dynamic MAP looks like small dot on Blank Map.

have added below code from Esri sample code... but this will not zoom inside Loaded Dynamic MAP.. but will show as small dot... then need to zoom in manually TAP gesture/ touch ....

    AGSSpatialReference *spatialReference = [AGSSpatialReference wgs84SpatialReference];

  //zoom to dynamic layer

  AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-178.217598362366 ymin:18.9247817993164 xmax:-66.9692710360024 ymax:71.4062353532712 spatialReference:spatialReference];

 

    AGSGeometryEngine *geometryEngine = [AGSGeometryEngine defaultGeometryEngine];

    AGSEnvelope * webMercatorEnvelope = (AGSEnvelope*) [geometryEngine projectGeometry:envelope toSpatialReference:self.mapView.spatialReference];

 

  [self.mapView zoomToEnvelope:webMercatorEnvelope animated:YES];

i need to zoom inside dynamic MAP....when it is loaded...

0 Kudos
2 Replies
GagandeepSingh
Occasional Contributor II

How are you getting the coordinates you are using to create the envelope? Is it possible to share some screenshot of what you have right now and what you expect?

0 Kudos
GajaNaik
New Contributor III

Hello,

i realise whats the problem here, this is link to question i had asked earlier

Displaying Current Location on MAP, not Working (when Tiled Layer not added)

i did workaround ..and now getting desired result.

MAP was zoom on Base layer envelope and SP, base layer opacity was 0(as i was force to add Tiled Layer without requirement because issue i mentioned to Esri earlier),

now i am getting 1st Layer info(Dynamic Layer), using its envelope and SP to zoom to Layer.

0 Kudos