简体   繁体   English

如何在Google地图中设置25公里的缩放级别?

[英]how to set zoom level in 25km in google map?

I would like set my google map zoom level 25km. 我想将我的Google地图缩放级别设置为25公里。 How it will be set my google api map please help me 它将如何设置我的Google api地图,请帮助我

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). 这可能是答案所在,您可以在要显示的点周围定义2个点,该点的西北1个点(距离12.5公里),西南1个点(相距12.5公里)。 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) 因此,您应该考虑是否要这样做,或者只是选择适当的初始缩放级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM