我有这段代码应该在谷歌地图中显示标记:
var latitudine='<?echo php $_POST['lat']; ?>';
var longitudine='<?echo php $_POST['lon']; ?>';
var myCenter=new google.maps.LatLng(latitudine,longitudine);
function initialize()
{
var mapProp = {
center: myCenter,
zoom:5,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
var marker = new google.maps.Marker({
position: myCenter,
title:'Click to zoom'
});
marker.setMap(map);
// Zoom to 9 when clicking on marker
google.maps.event.addListener(marker,'click',function() {
map.setZoom(15);
map.setCenter(marker.getPosition());
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
但是当我可视化地图时,我没有标记。我可以通过哪种方式转移值“纬度”和“经度”?