Changeset 7135
- Timestamp:
- 05/10/08 01:20:59 (2 months ago)
- Files:
-
- trunk/openlayers/examples/wfs-t.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/wfs-t.html
r7132 r7135 2 2 <head> 3 3 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 4 <style type="text/css"> 5 #map { 6 width: 800px; 7 height: 512px; 8 border: 1px solid black; 4 <link rel="stylesheet" href="style.css" type="text/css" /> 5 <style> 6 .olControlSaveFeaturesItemActive { 7 background-image: url("../theme/default/img/save_features_on.png"); 8 background-repeat: no-repeat; 9 background-position: 0px 1px; 10 } 11 .olControlSaveFeaturesItemInactive { 12 background-image: url("../theme/default/img/save_features_off.png"); 13 background-repeat: no-repeat; 14 background-position: 0px 1px; 9 15 } 10 16 </style> … … 13 19 <script type="text/javascript"> 14 20 var map, wfs; 15 OpenLayers.ProxyHost = "proxy.cgi?url=";21 OpenLayers.ProxyHost = "/proxy/?url="; 16 22 17 23 function init() { … … 30 36 typename: "tasmania_cities", 31 37 featureNS: "http://www.openplans.org/topp", 32 extractAttributes: false 38 extractAttributes: false, 39 commitReport: function(str) { 40 OpenLayers.Console.log(str); 41 } 33 42 } 34 43 ); … … 40 49 }); 41 50 42 var d p= new OpenLayers.Control.DrawFeature(51 var draw = new OpenLayers.Control.DrawFeature( 43 52 wfs, OpenLayers.Handler.Point, 44 53 { … … 47 56 } 48 57 ); 58 59 var save = new OpenLayers.Control.Button({ 60 trigger: OpenLayers.Function.bind(wfs.commit, wfs), 61 displayClass: "olControlSaveFeatures" 62 }); 49 63 50 d p.featureAdded = function(feature) {64 draw.featureAdded = function(feature) { 51 65 var oldgeom = feature.geometry; 52 66 feature.layer.renderer.eraseGeometry(oldgeom); … … 57 71 58 72 panel.addControls([ 59 new OpenLayers.Control.Navigation(), dp 73 new OpenLayers.Control.Navigation(), 74 save, draw 60 75 ]); 61 76 62 77 map.addControl(panel); 63 78 64 map.zoomToExtent(new OpenLayers.Bounds(14 5.51045,-44.0,149.0,-40.5));79 map.zoomToExtent(new OpenLayers.Bounds(140.64,-44.42,151.89,-38.80)); 65 80 } 66 81 … … 69 84 <body onload="init()"> 70 85 71 <h1 id="title">WFS Example</h1>86 <h1 id="title">WFS Transaction Example</h1> 72 87 73 88 <div id="tags"> 74 89 </div> 75 90 <p id="shortdesc"> 76 Shows the use of the WFS layer type.91 Shows the use the WFS layer for transactions. 77 92 </p> 78 93 79 <a href="#" onclick="OpenLayers.Console.log(wfs.commit());return false">Save Cities</a><br /> 80 81 <div id="map"></div> 94 <div id="map" class="smallmap"></div> 82 95 83 96 <p id="docs">
