Source Code Google Maps API [Latihan-2]

Posted: December 7, 2010 in Google Maps Dev
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
    <script src=";v=2&amp;sensor=false&amp;
  <body onUnload="GUnload()"> 
    <div id="map" style="width: 550px; height: 450px"></div>  
    <noscript><b>Javascriptnya kudu Enable, ni mo buka Google Maps rek....</noscript> 
    <script type="text/javascript">  
	 var baseIcon = new GIcon();
          baseIcon.iconSize=new GSize(32,32);
          baseIcon.shadowSize=new GSize(56,32);
          baseIcon.iconAnchor=new GPoint(16,32);
          baseIcon.infoWindowAnchor=new GPoint(16,0);
      var ico1 = new GIcon(baseIcon, "", null, "");
      var ico2 = new GIcon(baseIcon, "", null, "");
      var ico3 = new GIcon(baseIcon, "", null, "");
      var ico4 = new GIcon(baseIcon, "", null, "");
      var ico_jin = new GIcon(baseIcon, "icon_jin.png", null, "icon_jins.png");
	function createMarker(point,html,icon) {
        var marker = new GMarker(point,icon);
        GEvent.addListener(marker, "click", function() {
        return marker;
    if (GBrowserIsCompatible()) {  
      var map = new GMap2(document.getElementById("map"));
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(-4.039618,114.65332),4); 
	  var point = new GLatLng(-7.231699,112.368164);
      var marker = createMarker(point,'Marker WIndow 1, dari icon yang anda klik',ico1)
      var point = new GLatLng(-6.489983,107.138672);
      var marker = createMarker(point,'Marker WIndow 2, dari icon yang anda klik',ico2)
      var point = new GLatLng(-0.747049,113.862305);
      var marker = createMarker(point,'Marker WIndow 3, dari icon yang anda klik',ico3)
      var point = new GLatLng(-3.294082,126.870117);
      var marker = createMarker(point,'Marker WIndow 4, dari icon yang anda klik',ico4)
	  var point = new GLatLng(-1.45004,101.953125);
      var marker = createMarker(point,'Menampilkan Info Marker JIN 😀 , dari icon yang anda klik',ico_jin)
    else {
      alert("Sepurane rek.., Google Maps tidak bisa dibuka dengan browser ini");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s