snapping to features on multiple layers (OL3)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

snapping to features on multiple layers (OL3)

krzyssk
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


 

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: snapping to features on multiple layers (OL3)

Jana Golinowski
> 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.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users