[OpenLayers-Commits] r2381 - sandbox/vector/examples
commits at openlayers.org
commits at openlayers.org
Tue Mar 6 10:42:17 EST 2007
Author: pgiraud
Date: 2007-03-06 10:42:16 -0500 (Tue, 06 Mar 2007)
New Revision: 2381
Modified:
sandbox/vector/examples/wfs-T.html
Log:
fixed broken demo
added links for mouseListeners and modifications save
Modified: sandbox/vector/examples/wfs-T.html
===================================================================
--- sandbox/vector/examples/wfs-T.html 2007-03-06 15:21:36 UTC (rev 2380)
+++ sandbox/vector/examples/wfs-T.html 2007-03-06 15:42:16 UTC (rev 2381)
@@ -33,17 +33,16 @@
*/
map = new OpenLayers.Map('map');
-
+
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms-c/Basic.py", {layers: 'basic'} );
map.addLayer(layer);
-
+
layer = new OpenLayers.Layer.WMS( "Scribble WMS",
"http://dev.openlayers.org/geoserver/wms", {layers: 'topp:line', 'format':'image/png', 'transparent':true, STYLES:'line'});
map.addLayer(layer);
-
line = new OpenLayers.Layer.WFS("Scribble WFS",
"/geoserver/wfs",
{typename: "line2", geometry_column: 'the_geom', maxZoomLevel : 4},
@@ -56,6 +55,7 @@
}
map.addControl(new OpenLayers.Control.MousePosition());
+ map.setVectorLayer(line);
}
// -->
@@ -63,7 +63,22 @@
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
+ <div id="toolbar">
+ <a href="javascript:void(0);" id="Selection" onclick="chooseEditingTool(this);" >selection</a>
+ <a href="javascript:void(0);" id="DrawLineString" onclick="chooseEditingTool(this);" >draw line</a>
+ <a href="javascript:void(0);" id="MovePathPoint" onclick="chooseEditingTool(this);" >move path point</a>
+ |
+ <a href="javascript:void(0);" id="Commit" onclick="line.commit();" >save modifications</a>
+ </div>
<div id="map"></div>
+ <script type="text/javascript">
+ function chooseEditingTool(node) {
+ map.resetMouseListeners();
+ var mouseListener = new OpenLayers.MouseListener.EditingListener[node.id]();
+ map.addMouseListener(mouseListener);
+ }
+ </script>
+
</body>
</html>
More information about the Commits
mailing list