here is what i do.
if ($('#map_canvas').length != 0) {
var marker= new GIcon(title);
marker.image = '/images/icon.png';
marker.iconSize = new GSize(139,64);
marker.iconAnchor = new GPoint(0, 64);
marker.name = title ;
markerOptions = { icon:marker };
map = new GMap2(document.getElementById("map_canvas"));
geocoder = new GClientGeocoder();
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 14);
map.addOverlay(new GMarker(point, markerOptions));
}
}
);
}
});
If this is not helping you can take a look at: http://code.google.com/intl/da/apis/maps/documentation/javascript/overlays.html#Icons
Profeten
2010-10-28 12:08:40