我试图找到我在地图上添加的经纬度。我已经尝试了很多东西,但无法弄清楚。
function initialize() {
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(41,29),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
google.maps.event.addListener(map, 'click', function(e) {
placeMarker(e.latLng, map);
});
}
function placeMarker(position, map) {
var marker = new google.maps.Marker({
position: position,
map: map,
draggable: true
});
map.panTo(position);
}
google.maps.event.addDomListener(window, 'load', initialize);