Allow to pan the map while drawing in some examples, p=jorix, r=me (closes #3271)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11969 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2011-05-16 07:12:03 +00:00
parent c82704905d
commit d45edfb2c0
3 changed files with 20 additions and 19 deletions

View File

@@ -85,8 +85,11 @@
<p>
Use the tools to create, modify, and delete (in order from left
to right) features. Use the save tool (picture of a disk) to
save your changes. Use the navigation tool (hand) to stop
editing and use the mouse for map navigation.
save your changes.
</p>
<p>
To deactivate "drawing" or "modifying" depress the
corresponding button.
</p>
<p>
See the <a href="wfs-protocol-transactions.js" target="_blank">

View File

@@ -43,7 +43,8 @@ function init() {
maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508),
restrictedExtent: extent,
controls: [
new OpenLayers.Control.PanZoom()
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Navigation()
]
});
var gphy = new OpenLayers.Layer.Google(
@@ -69,12 +70,9 @@ function init() {
map.addLayers([gphy, wfs]);
var panel = new OpenLayers.Control.Panel(
{'displayClass': 'customEditingToolbar'}
);
var navigate = new OpenLayers.Control.Navigation({
title: "Pan Map"
var panel = new OpenLayers.Control.Panel({
displayClass: 'customEditingToolbar',
allowDepress: true
});
var draw = new OpenLayers.Control.DrawFeature(
@@ -104,8 +102,7 @@ function init() {
displayClass: "olControlSaveFeatures"
});
panel.addControls([navigate, save, del, edit, draw]);
panel.defaultControl = navigate;
panel.addControls([save, del, edit, draw]);
map.addControl(panel);
map.zoomToExtent(extent, true);
}

View File

@@ -107,7 +107,8 @@
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
controls: [
new OpenLayers.Control.PanZoom()
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Navigation()
]
});
@@ -203,9 +204,10 @@
split.activate();
// add some editing tools to a panel
var panel = new OpenLayers.Control.Panel(
{displayClass: 'customEditingToolbar'}
);
var panel = new OpenLayers.Control.Panel({
displayClass: 'customEditingToolbar',
allowDepress: true
});
var draw = new OpenLayers.Control.DrawFeature(
wfs, OpenLayers.Handler.Path,
{
@@ -233,11 +235,9 @@
panel.addControls([
new OpenLayers.Control.Navigation(),
save, del, modify, draw
]);
panel.defaultControl = panel.controls[0];
map.addControl(panel);
map.setCenter(new OpenLayers.LonLat(-11561460.5, 5541773), 15);
}
@@ -280,8 +280,9 @@
updating, or deleting of existing features.</p>
<p>Use the tools to create, modify, and delete (in order from left
to right) features. Use the save tool (picture of a disk) to
save your changes. Use the navigation tool (hand) to stop editing
and use the mouse for map navigation.</p>
save your changes.</p>
<p>To deactivate "drawing" or "modifying" depress the corresponding
button.</p>
</div>
</body>