I am using the custom marker option in gmap4rails and implementing mainly in CoffeeScript. Though the default option for markers is to add a shadow, I wish to remove it but could not locate anywhere the setting to remove a shadow from a marker.
The view:
The Class to create the custom markers:
class CustomMarkerBuilder extends Gmaps.Google.Builders.Marker
create_marker: ->
options = _.extend @marker_options(), @rich_marker_options()
@serviceObject = new RichMarker options
rich_marker_options: ->
marker = document.createElement("div")
marker.setAttribute('class', 'custom_marker_content')
marker.innerHTML = this.args.custom_marker
marker.shadow
{ content: marker }
The CoffeeScript action to show all markers:
allLocations = root.table.rows().data()
$('#multi_markers').map ->
handler = Gmaps.build("Google", builders: { Marker: CustomMarkerBuilder })
handler.buildMap
internal:
id: "multi_markers"
, ->
for aLocation in allLocations
markers = handler.addMarkers([
{
lat: aLocation[9]
lng: aLocation[10]
custom_marker: "<img src='/assets/images/redDotMarker.png' width='40' height='40'>"
custom_infowindow: "Store Number: #{aLocation[1]}; Address: #{aLocation[2]}, #{aLocation[3]}; Major Bidding City: #{aLocation[6]}"
}
])
handler.bounds.extendWith markers
handler.fitMapToBounds()
return
How can the shadow be removed from the markers in the CoffeeScript?
Append
@serviceObject.setShadow("")
to remove marker shadows.