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

support for z-index in markers in v2? #463

Closed johnnymo87 closed 9 years ago

johnnymo87 commented 9 years ago

edit: I'm on version 2.1.2

I need to up the z-index on a few on my markers, and right now I'm using a hack to do it. I'm passing down a fake shadow attribute like so: marker.shadow({ :url => 'hello' }), and then I'm responding accordingly in my js like so:

    handler.buildMap(settings, function() {
      var markers = handler.addMarkers(data);
      _.each(markers, function(marker) {
        if (marker.serviceObject.shadow != null) {
          marker.serviceObject.setZIndex(0);
        } else {
          marker.serviceObject.setZIndex(1);
        }
      })
      handler.bounds.extendWith(markers);
    })

This is pretty hacky, and I was hoping to do something with marker.json like described here, but unfortunately it seems like passing down marker.json({ :zindex => 1 }) has no effect anymore.

Am I missing something, or has support for passing down a z-index been removed?

apneadiving commented 9 years ago

Please ask questions on stackoverflow