Google Maps网址参数 [英] Google Maps url parameters

查看:122
本文介绍了Google Maps网址参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google地图的网址请求中,必须定义域的中心: url = http://maps.googleapis.com/maps/api/staticmap? center = 10.027489,51.229248& size = 650x650& zoom = 14& sensor = false



即使当我使用缩放或尺寸玩时, t得到我想要的确切地图。有没有办法定义域的西南角和东北角?或者任何其他方式来更好地定义一个域?

解决方案

是的,您可以使用 code>参数来指定矩形区域的两个对角,地图会自动调整中心和缩放以适应该区域。



请参阅隐式定位地图(有一个例子)


In url requests for Google Maps, the center of the domain has to be defined:

url = "http://maps.googleapis.com/maps/api/staticmap?center=10.027489,51.229248&size=650x650&zoom=14&sensor=false"

Even when I play with zoom or size, I don't get the exact map that I want. Is there a way to define the southwest and northeast corners of the domain ? Or any other way to better define a domain ?

解决方案

Yes, you can use the visible parameter to specify the 2 opposite corners of a rectangular region, and the map will automatically adjust center and zoom to fit that region.

See Implicit Positioning of the Map (there's an example there).

这篇关于Google Maps网址参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆