Reputation: 732
I have multiple map views and each view has a group of map markers
e.g. Map View 1 = 4 map markers, Map View 2 = 10 map markers, Map View 3 = 20 map markers.
In most instances the map markers are a few meters from each other and in other instances they are a few miles apart.
Is there an easy way to set the Map View such that it automatically zooms in such that it encompasses the map markers in each view. If i have to do it manually no amount of zoom level will never be perfect.
An alternative is to define a center and a custom zoom level for each map view but that sounds a bit tedious.
Upvotes: 1
Views: 170
Reputation: 519
There is no automatic function for doing this - you can calculate the bounding box corresponding to the POI cluster (i.e. find the top left lat and long and bottom right lat and long) and zoom to that bounding box.
Upvotes: 2