Changing Google Map Markers?

Associate
Joined
21 Oct 2008
Posts
1,679
Location
Mooching... in your house
I can't seem to work out how to change the default balloon icon on a google map, I have created my own standard and hover images that I would like to use but I find it really tricky to get my head around the Google API stuff... could anyone point me in the right direction?
 
Here's a small, quick example :)
Code:
var point =new GLatLng(x,y)//x, y are where you want the point to be.
var icon=new GIcon();
icon.image='/path/to/your/image.png'

//add marker to your map using addoverlay
//e.g. GMap2.addOverlay(new Gmarker(point,icon))

Edit: forgot code tags, and made a mistake :o
 
Last edited:
I've been playing with the above code, but i couldn't get it going... this as as close as i've got but still no cigar, could someone help me out?

Code:
// custom marker icon
var icon = new GIcon();
icon.image = '/resources/images/dot.png';

// set up a marker with info
var point = new GLatLng(-37.80387,144.99056);
var marker = createMarker(point,'<div style="font: 10px Arial;"><b>Dusk Lighting</b></div>')

map.addOverlay(marker,icon);
 
Last edited:
Back
Top Bottom