嗨,你可以这样使用
function initialize() {
var fenway = new google.maps.LatLng( <? php echo latitude from db ?> , <? php echo echo longtitude from db; ?> );
var mapOptions = {
center: fenway,
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var image = '<?php echo $path;?>components/com_propertylist/images/Home.png';
var beachMarker = new google.maps.Marker({
position: fenway,
map: map,
icon: image
});
google.maps.event.addDomListener(window, 'load', initialize);
// google.maps.event.trigger(map, 'resize');
}