All pastes #886755 Raw Edit

Untitled

public text v1 · immutable
#886755 ·published 2008-01-31 22:12 UTC
rendered paste body
              map = new GMap2(document.getElementById(mapElement));
              map.addControl(new GSmallMapControl());
              map.addControl(new GMapTypeControl());              
              map.setCenter(new GLatLng(el['lat'], el['long']), 15);

              /* Creating the custom icon */
              customIcon = new GIcon(G_DEFAULT_ICON, "http://webapp.traqr.com/images/car.gif");
              customIcon.iconSize = new GSize(32, 18);
              customIcon.iconAnchor = new GPoint(16, 9);

              var point = new GLatLng(el['lat'], el['long']);
              marker = new GMarker(point,{icon : customIcon});

              GEvent.addListener(marker, 'click', function(){
                 marker.openInfoWindowHtml('Marker') ;
              });
              console.log(map); 
              map.addOverlay(marker);