I need a help in showing the correct zoom level in Titanium maps for Android.
I am showing the route from current location to some other location.The distance is different every time. Can it be possible that I calculate the values of latitudeDelta and longitudeDelta based on the distance and show the map zoomed up according to that? If yes, how could it be possible?
Thanks in advance!
As the the documentation states the smaller the delta value, the closer the zoom on your map. That means 0.01 will zoom in more as compared to 0.1 for delta (latitude, longitude). As these values are hardcoded in the regions parameter, I would recommend is to use a function that would dynamically populate latitudeDelta: & longitudeDelta: based on the distance. So if the distance is more you can have a higher value for delta's else lesser values.
Here is one such function:
To corresponding delta values:
Hope this Helps!!