[OpenLayers-Users] Vector Layer w/ Canvas Renderer Not Respecting Other Layers
Mike Ryan
mr at mry4n.net
Wed Jun 27 11:49:08 PDT 2012
Following up on this, since I haven't heard anything. I've played around
with the canvas hit detection example here:
http://dev.openlayers.org/releases/OpenLayers-2.11/examples/canvas-hit-detection.html
and did the following:
- made an overlay layer with some of features so that I could turn the
layer on/off
- added the LayerSwitcher control to the map
- added onFeatureSelect and onFeatureUnselect events to the layers so a
popup appears when you click on the features
- the popups appear when clicking on the visible features
- AND the popups appear when clicking on the "invisible" features in the
overlay when it is TURNED OFF
So, is this an issue with the HTML5 Canvas element itself or the way OL
uses it to render Vector layers?
Does turning a Canvas layer "off" via LayerSwitcher require some extra code?
-Mike
On 6/26/2012 1:42 PM, Mike Ryan wrote:
> When I add a Vector layer using a Canvas renderer two bad things happen:
>
> 1. Other Vector layers with points that have click events attached and
> are within the area covered by the Canvas layer are no longer
> clickable. The Canvas layers is blocking the click event.
>
> If a click event was added to the Canvas layer, the Canvas click event
> is fired rather than the point's in the other layer.
>
> Points in the other layer that are not within the Canvas layer area
> work properly.
>
> 2. Even when I switch off the Canvas layer with the layerswitcher, the
> Canvas layer still behaves the same way -- even though the canvas
> layer can no longer be seen.
>
> Who's got an idea of what might be going on here?
>
> -Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120627/b09db82f/attachment.html>
More information about the Users
mailing list