We’ve been advancing the editing capabilities of OpenLayers with each release since the initial inclusion of the vector feature rendering in 2.4. The upcoming 2.8 release will bring two new enhancements that I’m particularly excited about: snapping and splitting.
The snapping example demonstrates some of the configuration options of the snapping agent. This control can be set up to work with any number of target layers. Modified features in a source layer are snapped to eligible features in target layers based on tolerance settings. Snapping options for nodes, vertices, and edges can be independently configured.
The split feature example uses the new split control to generate temporary sketches for splitting existing features. The control can also be configured to listen for edits on an existing layer and split features on any target layer.
The snapping and split controls can be used together to provide an editing environment that maintains some basic topology rules. Both controls trigger events that let the application designer customize exactly what happens before, during, and after snapping and splitting. You can find documentation and additional examples for both of the controls in the growing prose documentation.
Thanks to Sweco for supporting this work. We’re excited to have it in the trunk.