[OpenLayers-Users] snapping to features on multiple layers (OL3)

Jana Golinowski jgolinowski at codematix.de
Fri Dec 9 02:34:44 PST 2016


> 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.


More information about the Users mailing list