       }
     }
   }
-  handler.buildMap { 
+  handler.buildMap {
     provider: {
       zoom: 4,
       center: new google.maps.LatLng(52.31, 13.22),

class RichMarkerBuilder extends Gmaps.Google.Builders.Marker #inherit from builtin builder
  #override create_marker method
  create_marker: ->
    options = _.extend @marker_options(), @rich_marker_options()
    @serviceObject = new RichMarker options #assign marker to @serviceObject

  rich_marker_options: ->
    marker = document.createElement("div")
    marker.setAttribute 'class', 'marker_container'
    marker.innerHTML = @args.title
    { content: marker }

@buildMap = (markers_arg) ->

# handler.event.addListener(marker, 'mouseout', function() {
#   infowindow.close();
# })

makeIW = (title) ->
  content = document.createElement 'div'
  content.innerHTML = title
  new google.maps.InfoWindow { content: content }


# addHoverHandlers = (markers) ->
#   # m is Gmap4Rails marker, doc in gmaps4rails.base.js.coffee
#   for m in markers
#     # marker is a Google Maps Marker
#     # https://developers.google.com/maps/documentation/javascript/reference#Marker
#     marker = m.serviceObject
#
#     console.log marker.getPosition().toString()
#     # Show the infowindow when user mouses-in
#     google.maps.event.addListener marker, "mouseover", ->
#       console.log marker.getPosition().toString()
#       # Loop on Gmaps.map.markers and find the one using this
#       for m2 in Gmaps.map.markers
#         if m2.serviceObject == this
#           m2.infowindow.open m2.serviceObject.map, m2.serviceObject
#
#     # Hide the infowindow when user mouses-out
#     google.maps.event.addListener marker, "mouseout", ->
#       m.infowindow.close()
