apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.27k stars 382 forks source link

when mouseover or out change icon marker #452

Closed dugdodotcom closed 10 years ago

dugdodotcom commented 10 years ago

I want to make when div mouseover then the icon change, like hovering.

handler = Gmaps.build("Google", markers: maxRandomDistance: null ) handler.buildMap provider: {} internal: id: "map-canvas" , -> markers = handler.addMarkers(ar) _.each ar, (json, index) -> json.marker = markers[index] $(".location-" + json.id).on("mouseover", -> json.picture = url: "http://maps.google.com/mapfiles/ms/icons/green-dot.png" width: 36 height: 36 console.log json.marker json.marker.setMap handler.getMap() json.marker.panTo() handler.removeMarker json.marker handler.addMarker json return ).on "mouseout", -> handler.removeMarker json.marker handler.addMarker json.marker return

      return
    handler.bounds.extendWith markers
    handler.fitMapToBounds()
apneadiving commented 10 years ago

please ask questions on stackoverflow

dugdodotcom commented 10 years ago

https://stackoverflow.com/questions/25637790/when-mouseover-or-out-change-icon-marker