【发布时间】:2009-11-02 21:00:43
【问题描述】:
我有一个谷歌地图并加载它,但我想通过改变中心来改变方向或中心,我该怎么做?我有这样的代码来加载地图:
function putmap(x) {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("Map"));
// Create new geocoding object
geocoder = new GClientGeocoder();
// Retrieve location information, pass it to addToMap()
geocoder.getLocations(x, addToMap);
}
}
我想通过在文本框中输入一个新值来更改 x 的值,我该怎么做...
【问题讨论】:
-
我不确定您要做什么。您是 Google Maps API 还是只是想在地图上导航?
-
我成功将地图加载到我的网页,但我想动态更改中心,我该怎么做?
-
您的问题需要更多细节。请更新。
-
是的,您只是在寻找
setCenter的文档吗?如果是这样,你去:code.google.com/apis/maps/documentation/v3/reference.html#Map
标签: google-maps many-to-many mashup