Modifying features
When working on the web mapping application, most probably, the capability to allow the users to add new features would be a desired requirement, but what about modifying features such as move vertex, rotate features, scale, and so on?
Again, OpenLayers simplifies our lives as developers, giving us the powerful OpenLayers.Control.ModifyFeature
control:
This time we are going to create a little application that will provide us with two important controls: first, to add new features and second, to modify them. For this purpose, we will use the OpenLayers.Control.EditingToolbar
and OpenLayers.Control.ModifyFeature
controls.
In concrete, we will see how we can reshape, resize, rotate, and drag features. In addition, we will see how to filter what kind of features can be affected by the modifications.
How to do it...
Let's start with creating the controls required for managing the control to modify a feature:
<form action=""> <button data-dojo-type="dijit.form.ToggleButton...