In one my Rails applications, I allow the user to search for surrounding businesses from their current location. I always showed them a You Are Here marker. The issue I had with this was that the marker was always the icon as the search results. Differentiating these markers is actually extremely easy with ym4r_gm plugin.
First thing is to find a custom icon that you want to use. You can just Google for custom Google maps icons. I chose to use their default icon, just in a different blue. (You can download it here so you are working with what I am working with for this example). The next thing I did was to use the Google custom markers web site to find the proper config options for the icon.
GIcon.new( :image => "/images/gmap_blue_icon.png",
:icon_size => GSize.new(32, 32),
:icon_anchor => GPoint.new(16, 32),
:info_window_anchor => GPoint.new(16, 0)), 'youarehere_icon')
youarehere_icon = Variable.new('youarehere_icon')
@map.center_zoom_init( [ @location.lat, @location.lng ], 15 )
youarehere = GMarker.new( [ @location.lat, @location.lng ],
:title => "You Are Here",
:info_window => "You Are Here",
:icon => youarehere_icon,
:draggable => false
@map.declare_init( youarehere, 'youarehere' )
@map.overlay_init( youarehere )
A few things worth nothing about this code in order to better understand what it’s doing.
The rest of the code is similar to your regular ym4r_gm map icon stuff.