2011年12月3日星期六

網頁設計筆記(十八) Google Map


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" language="javascript">
function initialize() {
  var latlng = new google.maps.LatLng(22.330411, 114.200878);

  var myOptions = {
      zoom: 14,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
  };


  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

  var companyLogo = new google.maps.MarkerImage('/media/images/contact%20us/repair_station.png',
new google.maps.Size(59,82),
new google.maps.Point(0,0),
new google.maps.Point(29,78)
  );
 
  var companyPos;
  var openStatus = '';
 
  //companyPos = new google.maps.LatLng(22.338411, 114.200878);
 
  companyMarker = new google.maps.Marker({
position: latlng,
map: map,
//icon: companyLogo1,
title:"Repair Station"
  });
}
</script>
<style>
#map_canvas { width:500px; height:500px; }
</style>
<title>無標題文件</title>
</head>

<body onload="initialize();">
<div id="map_canvas"></div>
</body>
</html>