开发者

how to set zoom level in 25km in google map?

开发者 https://www.devze.com 2023-03-26 21:12 出处:网络
I woul开发者_开发百科d like set my google map zoom level 25km. How it will be set my google api map please help me

I woul开发者_开发百科d like set my google map zoom level 25km. How it will be set my google api map please help me

Regards,


You may want to check the documentation first.

map.setCenter(new GLatLng(37.4419, -122.1419), 13);

The second parameter should be the zoom level.


I thinks it's not such weird question, assuming he read the documentation, and knows he can set the zoomlevel in a ratio. This ratio is a kind of weird choice... it depends on the initial chosen bounds, and not very intuitive in that matter.

Here lies maybe the answer, you could define 2 points around the point you want to show, one northwest of the point (distance 12,5 km.) and 1 point southwest (also 12,5 km disctance). Than create bounds with this points and zoom to this bound.

A lot of coding, but it can be done.

So you should consider whether you want this, or just choose a proper inital zoomlevel.... (in ratio, not in km)

0

精彩评论

暂无评论...
验证码 换一张
取 消