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

Old Gmaps4rails 1.5.6 and making a custom marker render below the default markers #460

Closed mtc2013 closed 9 years ago

mtc2013 commented 9 years ago

Is there a way to do this from the ruby side? I tried this: def gmaps4rails_marker_picture return { "zIndex" => 0, "picture" => "/assets/redcircle.png" } if not_updated_recently_or_has_no_owner return {"zIndex" => 1} end

But it didn't change anything, from what I can see, except insert those values in the DOM.

apneadiving commented 9 years ago

hard to tell, looks like valid code and zIndex was properly handled by this version. I dont know

mtc2013 commented 9 years ago

This commit worked for our particular purposes: https://github.com/mtc2013/LocalSupport/commit/6f683b69062499abf4877e8998a8e08f605347c4

apneadiving commented 9 years ago

Ah ok I understand now, did you try:

marker.json({ zindex: org.send(:not_updated_recently_or_has_no_owner?) ? 1 : 0 })
mtc2013 commented 9 years ago

No but if it works, that's better.