Mapview with proper zoom level

You must Login before you can answer or comment on any questions.

Hi, All,

I am displaying about 10 points on MapView using Annotations, and these 10 points are in vicinity of eacher other. The farthest point should not be over 5Km from the Geolocation point.

My problem is how can I display all the points in the MapView without user's scrolling or panning. Is it controlled by the region attribute in the MapView class? I played around with different longitudeDelta and latitudeDelta values, but the MapView did not seem to change.

— asked 3 years ago by HC Yen
0 Comments

5 Answers

Accepted Answer

try something like this:

mapview.setLocation({latitude:.latitude,longitude:,animate:true,latitudeDelta:0.01, longitudeDelta:0.01});
But yes, it has to do with the latitudeDelta and longitudeDelta

Is there any difference if I don't use setLocation? What if I just use Map.createView?

I changed both latitudeDelta and longitudeDelta from 0.01 to 0.05, and the map view did not change.

try to change it from 0.01 to 0.001.

the set location is basicly the same as creating it in a map view, i fire this command if i update something on my mapview.

I guess my other questions are :

When I change the delta to a smaller value, is it similar to zoom in or zoom out?

What if I set longitudeDelta and latitudeDelta to different values?

Your Answer

Think you can help? Login to answer this question!