我在其中使用 Google 地图创建了一个 Web 应用程序。我需要知道如何实现,当我使用 php 搜索某个位置并在 php array() 中得到结果时,包含不同位置坐标(纬度经度)的数组结果显示在地图上 + 关注地图视图中的这些坐标......
问问题
803 次
2 回答
1
您需要创建一个 GBound 并在稍后使用 extend() 方法创建所有要点。 https://developers.google.com/maps/documentation/javascript/v2/reference#GBounds
然后使用 map.fitBounds() 方法在这些点上设置视图。 https://developers.google.com/maps/documentation/javascript/reference
于 2012-09-02T20:45:02.543 回答
0
如果您不需要地图滚动,请使用 Google 静态地图 API: https ://developers.google.com/maps/documentation/staticmaps/
将<img>
标签添加到您的 HTML 中,源代码格式如下:
https://maps.googleapis.com/maps/api/staticmap?center=LAT,LONG&zoom=14&size=288x200&sensor=false"
这将返回以您指定的坐标为中心的地图图像。
于 2012-09-02T19:29:41.287 回答