Posts Tagged ‘googlemap’


<!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"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=KEY&sensor=true"
type="text/javascript"></script>
<script type="text/javascript">

function initialize()
{
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(23.005, 72.5959), 15);
map.setUIToDefault(); // will add top menu,left menu etc

var marker = new GMarker(new GLatLng(23.005, 72.5959));
map.addOverlay(marker);
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 700px; height: 500px"></div>
</body>
</html>

Advertisements

Change google map marker image

Posted: March 28, 2012 in PHP
Tags:
<!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" />
<title>Google Map</title>
</head>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=YOUR_KEY&sensor=true"
            type="text/javascript"></script>
    <script type="text/javascript">

    function initialize()
	{
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(23.005, 72.5959), 15);
        map.setUIToDefault(); // will add top menu,left menu etc	

		var new_icon = new GIcon();
		new_icon.image = "images/car_blue.png" ; // image path
		new_icon.size = new GSize(16,16) ;
		new_icon.iconAnchor = new GPoint(6, 20);
		new_icon.infoWindowAnchor = new GPoint(5,1)  ;
		var marker = new GMarker(new GLatLng(23.005, 72.5959), new_icon);
		map.addOverlay(marker);
		}
	}
	 </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 700px; height: 500px"></div>
  </body>
  You can check more gmap images from
  <br /><a href="http://mabp.kiev.ua/2010/01/12/google-map-markers/" target="_blank">http://mabp.kiev.ua/2010/01/12/google-map-markers/</a>
  <br /><a href="http://www.visual-case.it/cgi-bin/vc/GMapsIcons.pl" target="_blank">http://www.visual-case.it/cgi-bin/vc/GMapsIcons.pl</a>
</html>