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);