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.
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.
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.