CartoDB / Leaflet.CanvasLayer

full screen canvas layer for Leaflet
118 stars 35 forks source link

Canvas layer is drawing behind geojson layer #18

Open ghost opened 9 years ago

ghost commented 9 years ago

I added a canvas layer and am rendering svg elements. I also have a geojson layer. The canvas layer is supposed to overlay the geojson layer, however, the svg elements on the canvas layer are being drawn under the geojson layer.

How do I bring the canvas layer to the front?

myCanvasLayer.bringToFront() does not work and according the source it is a no-op.

invoking 'myGeoJsonLayer.bringToBack()' does not help either.

ghost commented 9 years ago

[WORKAROUND]

mapInstance.getPanes()['tilePane'].style.zIndex = 2147483647;                 

This will get me by but I do not like it :-1:

javisantana commented 9 years ago

setZIndex is what you need, looks like bringToFront is not implemented

Zahma commented 7 years ago

@javisantana could you please laborate more how this setZIndex will help ?