[OpenLayers-Users] OL internal (vector) feature organisation

Lars Lingner ml at lingner.eu
Tue Aug 12 08:34:42 EDT 2008


Hello List,

the issue I have with OL is that I have multiple vector layers and want
to interact with each of them without switching any handler manually.

The author of Ticket #434 (http://trac.openlayers.org/ticket/434)
described that there are many svg tags like

<svg id="layer1">
    <path id="path1"/>
</svg>
<svg id="layer2">
    <path id="path2/>
    <path id="path3/>
</svg>

The problem with this structure is that events are handled inside only
one svg tag. The result is, that an handler can be bound to only one layer.

One solution described in #434 was to loop through all layers and check
if there is an object at the click coordinates.
So you are able to pass an array of layers to an control handler. While
that was working well, there are also some other issues with this
solution (patch).

- OL maps get really slow. On every point of the mouse courser OL is
checking all layers if there is an intersection with an object.

- Object which visible only in a scale frame (e.g. maxScaleDenom set)
are also handled

- clicking point objects is difficult. While in OL you can set an image
(like a marker) and that image is click sensitive, with the patch only
an specific area around the point is clickable

If I understand the comments on above ticket right, than would be a
proper solution to reorganize the object in one svg tag, like:

<svg>
    <path class="layer1" id="path1"/>
    <path class="layer2" id="path2"/>
    <path class="layer2" id="path3"/>
</svg>

If anybody could confirm/rebut this that would be great.

I'm sure that such an modification needs a lot of work to be done. But I
really want to do it and if its getting less complicated the better.

If anybody has any ideas to this topic please post it. I simply don't
know where to start.


lars



More information about the Users mailing list