API讨论组中报告这些情况。 地理编码,路径,等等 Google Maps API还没有包含地理编码和路由服务,但网罗上有很多的免费的地理编码。
示例: the basics 创建一副地图并将其中心定位在Palo Alto; var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-122.141944, 37.441944), 4); map movement and animation
var map = new GMap(document.getElementById("map")); GEvent.addListener(map, "moveend", function() { var center = map.getCenterLatLng(); var latLngStr = '(' + center.y + ', ' + center.x + ')'; document.getElementById("message").innerHTML = latLngStr; }); map.centerAndZoom(new GPoint(-122.141944, 37.441944), 4); 打开一个消息窗口(opening an info window) 显示一个指向地图中间的"hello world"信息窗口。信息窗口一般的会在标签上方被打开,但是他们也可以在地图的任何地方被打开。
var map = new GMap(document.getElementById("map")); map.centerAndZoom(new GPoint(-122.141944, 37.441944), 4); map.openInfoWindow(map.getCenterLatLng(), document.createTextNode("Hello world")); 地图叠加(Map Overlays) 创建了十个随机的标记和一个随机的折线来展示map overlays的用途 // Center the map on Palo Alto var map = new GMap(document.getElementById("map"));