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, "/images/jeep.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); GEvent.addListener(marker, 'click', function(){ marker.openInfoWindowHtml('Marker') ; }); console.log(map); map.addOverlay(marker, {icon : customIcon});