Select to view content in your preferred language

How to calculate min and max zoom scales for offline geodatabase using Android ArcGIS framework?

3768
2
09-29-2015 03:31 AM
ShailendraPatil
Deactivated User

I am stuck in setting MapView's min and max scale values, my current scales are

MAP_MIN_SCALE = 1000000;

MAP_MAX_SCALE = 1;

but these are not works for different geodatabase, my geodatabase spatial reference is WGS84.

mMapView.setMinScale(MAP_MIN_SCALE);

mMapView.setMaxScale(MAP_MAX_SCALE);

i have set this but i want this to be calculated dynamically, it works for one geodatabase but if i change geodatabase its not working for another geodatabase.

Please help me on this.

0 Kudos
2 Replies
DanO_Neill
Deactivated User

With respect to Geodatabases you should do this at the layer level. If a Layer in a Geodatabase has a min/max set the `MapView` will honor it. You can set the min/max scales on the layers. Use the setMinScale() & setMaxScale() on the layer from the Geodatabase.  This will allow you to override the min/maxScale property of a layer if it is set. 

DhruvinDesai
New Contributor

I had the same problem with basemaps. I noticed that I can get the minScale/maxScale from the layer (in my case: ArcGISTiledLayer) and it has the correct dynamic values so I don't have to hardcode in random values.

I take the values from the layer and set them on the ArcGISMap:

given a map: 

map = ArcGISMap()

map.setMinScale(layer.getMinScale()) 

map.setMaxScale(layer.getMaxScale())

 

This question is really old, but hoping it will help someone else since things have changed in the Android ESRI SDK along the way.

 

0 Kudos