Discussion:
snapping to features on multiple layers (OL3)
(too old to reply)
KS
2016-12-09 10:15:40 UTC
Permalink
Hi all,

Is it possible to setup ol.snap.interaction to Snaps objects on multiple layers while drawing,
as is in Openlayers version 2.

If anyone has an idea, and perhaps examples of how to accomplish this?

Many thanks,

Krzysztof
Jana Golinowski
2016-12-09 10:34:44 UTC
Permalink
Post by KS
Is it possible to setup ol.snap.interaction to Snaps objects on multiple
layers while drawing,
as is in Openlayers version 2.
If anyone has an idea, and perhaps examples of how to accomplish this?
I haven't used this yet but according to the api docs you can provide
either "features" or "source". My idea is to create a feature collection
of the features of all layer sources you want to use for snapping. This
collection can be passed directly via the "features" property. Or you
can create a new source with the collection and pass it via the "source"
property.

Hope this helps.

Jana.

Loading...