I've posted this problem to the users list but it probably makes more sense to post it here.

I'm having problems with Vector layers that use a Canvas renderer.

1. If the Canvas layer is placed below other layers (not rendered as Canvases) it doesn't allow click events (onFeatureSelect, etc.) to the overlapping layers ABOVE it.

2. If the Canvas layer has events on it they persist even when I turn off the Canvas layer using the LayerSwitcher and it continues to block the events of the layers above it.

3. The events do not persist if I turn the Canvas layer off and then pan the map.

I used/altered the Canvas hit detection example to verify some of the things above:

http://dev.openlayers.org/releases/OpenLayers-2.11/examples/canvas-hit-detection.html

My alterations to canvas.js -http://pastebin.com/tAV9Dvcx


I'm wondering if something could be altered in LayerSwitcher.js 's updateMap function to address this?

    updateMap: function() {
        ...
        // set the correct visibilities for the overlays
        for(var i=0, len=this.dataLayers.length; i<len; i++) {
            var layerEntry = this.dataLayers[i];
layerEntry.layer.setVisibility(layerEntry.inputElem.checked);
        }

Is it possible that setVisibility(false) when applied to a Canvas layer does not fully remove the layer from the map?

And even if that's correct, I still don't understand why the layer order is not respected.

Any thoughts?

-Mike
_______________________________________________
Dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to