O'Reilly logo

OpenLayers Cookbook by Antonio Santiago Perez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Editing features on multiple vector layers

When working with vector information, most probably, one of the most common things we can do in a GIS application is: add new features.

OpenLayers has plenty of controls, so there is no need to reinvent the wheel. We have a set of tools and the only thing we need to do is learn how to use each one.

For this concrete purpose, add new features. OpenLayers has the OpenLayers.Control.EditingToolbar control that shows a toolbar with some buttons to add polygons, polylines, and points:

Editing features on multiple vector layers

Because we can have many vector layers in the map, the control needs us to specify the layer it must work on.

In addition to showing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required