Hello,
I had an Android application that display a local .TPK file,, stored on the phone.
Starting with Android 14 the application does not start and I made an upgrade to ArcGis Runtime SDK 100.15.4
Now the map is displayed but I need to zoom it in order to make it visible. When the map is launched, the screen is with Esri grid, but the map is not visible. As soon as I was zoom it, the map become visible and I can zoom in or zoom out.
I think there is a scale issue or something like that. I read a lot but I did not found any relevant information.
Have you any idea?
The code is below:
Solved! Go to Solution.
Hi Robert,
This is likely related to the scale range (min/max scale) of your tpk data. You should be able to find out what the scale range is, by either:
- Reading the values of ArcGISTiledLayer.minScale & ArcGISTiledLayer.maxScale once the layer has loaded.
- Or by reading the TileInfo obtained from ArcGISTiledLayer.tileInfo once the layer has loaded. TileInfo.levelsOfDetail gives you access to each LevelOfDetail which in turn gives you the scale values of each level.
Once you know the min/max scale of your ArcGISTiledLayer you can set these properties on your ArcGISMap instance with ArcGISMap.minScale & ArcGISMap.maxScale. The MapView will then apply that min scale upon initial drawing of the map so your map should appear at the appropriate tile level from the start.
See related post: https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-calculate-min-and-max-...
related sample: https://developers.arcgis.com/android/kotlin/sample-code/set-min-max-scale/
Thank you for all your help, Gunther. The problem was solved. By setting a minimum scale in application, the map become visible when the application is open. The code is below
map.setMinScale(150000);
Hi Robert,
This is likely related to the scale range (min/max scale) of your tpk data. You should be able to find out what the scale range is, by either:
- Reading the values of ArcGISTiledLayer.minScale & ArcGISTiledLayer.maxScale once the layer has loaded.
- Or by reading the TileInfo obtained from ArcGISTiledLayer.tileInfo once the layer has loaded. TileInfo.levelsOfDetail gives you access to each LevelOfDetail which in turn gives you the scale values of each level.
Once you know the min/max scale of your ArcGISTiledLayer you can set these properties on your ArcGISMap instance with ArcGISMap.minScale & ArcGISMap.maxScale. The MapView will then apply that min scale upon initial drawing of the map so your map should appear at the appropriate tile level from the start.
See related post: https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-calculate-min-and-max-...
related sample: https://developers.arcgis.com/android/kotlin/sample-code/set-min-max-scale/
Thank you for all your help, Gunther. The problem was solved. By setting a minimum scale in application, the map become visible when the application is open. The code is below
map.setMinScale(150000);