Problem about zoomToScale in AGSMapView

715
2
03-04-2013 05:25 PM
SteveLeung
New Contributor
Hi,

I created a tiled map in ArcGIS Server with first level as 1:160000, second level as 1:80000 and so on. Then I attempted to run the code [mapView zoomToScale:1600000 ....] in iPhone, however, the map view displayed the second level tiled map instead of the first level tiled map. Do you guys encounter the same problem? Does anyone know how to calculate the scale in AGSMapView so as to display the first level tiled map? Thank you very much!

Regards,
Steve
0 Kudos
2 Replies
NimeshJarecha
Esri Regular Contributor
The scale is directly proportional to the DPI. The tiled layer you cached at 96 DPI and phone's DPI is different so the SCALE is different too. You should use AGSTiledMapServiceLayer's convertedScaleForLodScale: method to get correct scale on device. Then use zoomToScale and it'll zoom at correct level.

Hope this helps!

Regards,
Nimesh
0 Kudos
SteveLeung
New Contributor
I fixed the problem by using your mentioned method. Thanks!!!
0 Kudos