页面中显示google地图代码
<div id="map_canvas" style="height:200px; margin:0 auto; width:200px;"></div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
var arr = eval('[["逸海商务酒店",23.54811,113.60829,1]]');
var markers = new Array();
var map;
var latlng = new google.maps.LatLng(arr[0][1], arr[0][2]);
var myOptions = {
zoom:14,
center:latlng,
mapTypeId:google.maps.MapTypeId.ROADMAP,
mapTypeControl:false
}
var vmap_canvas = document.getElementById('map_canvas');
map = new google.maps.Map(vmap_canvas,myOptions);
for (var i = 0; i < arr.length; i++) {
var beach = arr[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map
});
//marker.openHTMLInfoWindow('dddd');
}
</script>