1
我想在网页中放置一张地图,用户可以根据需要放置交互式标记(位置引脚)。现在,无论何时放置标记,我都希望存储指定标记的lat,long值以保存在我的服务器(phpmyadmin)中的数据库中。在Google地图中添加交互式标记API
试图开始使用Google地图数据API。已经看过很多例子,但是找不到任何可以放置交互式标记的地方。
我想在网页中放置一张地图,用户可以根据需要放置交互式标记(位置引脚)。现在,无论何时放置标记,我都希望存储指定标记的lat,long值以保存在我的服务器(phpmyadmin)中的数据库中。在Google地图中添加交互式标记API
试图开始使用Google地图数据API。已经看过很多例子,但是找不到任何可以放置交互式标记的地方。
我要告诉你如何与v3 of the APi
google.maps.event.addListener(this.map, 'click', add_marker);
function add_marker(event) {
lat = event.latLng.lat;
lng = event.latLng.lng;
// ajax code here that posts the lat/lng to the server
// only call the remaining code to add the marker if it was successful
var marker = new google.maps.Marker({
position: event.latLng,
map: map // put the handle of your map here
});
}
非常感谢..! – Pow 2010-10-26 17:32:13