Adding the ability to change the aspect ratio of features while resizing with the modify feature control. Thanks for the patch rdewit! r=me (closes #1975)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9150 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -70,14 +70,16 @@
|
||||
var resize = document.getElementById("resize").checked;
|
||||
if(resize) {
|
||||
controls.modify.mode |= OpenLayers.Control.ModifyFeature.RESIZE;
|
||||
var keepAspectRatio = document.getElementById("keepAspectRatio").checked;
|
||||
if (keepAspectRatio) {
|
||||
controls.modify.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE;
|
||||
}
|
||||
}
|
||||
var drag = document.getElementById("drag").checked;
|
||||
if(drag) {
|
||||
controls.modify.mode |= OpenLayers.Control.ModifyFeature.DRAG;
|
||||
}
|
||||
// disable reshape mode if at least one of modes rotate, resize,
|
||||
// drag is enabled
|
||||
if (rotate || resize || drag) {
|
||||
if (rotate || drag) {
|
||||
controls.modify.mode &= ~OpenLayers.Control.ModifyFeature.RESHAPE;
|
||||
}
|
||||
var sides = parseInt(document.getElementById("sides").value);
|
||||
@@ -151,6 +153,9 @@
|
||||
<input id="resize" type="checkbox"
|
||||
name="resize" onchange="update()" />
|
||||
<label for="resize">allow resizing</label>
|
||||
(<input id="keepAspectRatio" type="checkbox"
|
||||
name="keepAspectRatio" onchange="update()" checked="checked" />
|
||||
<label for="keepAspectRatio">keep aspect ratio</label>)
|
||||
</li>
|
||||
<li>
|
||||
<input id="drag" type="checkbox"
|
||||
|
||||
Reference in New Issue
Block a user