OpenLayers OpenLayers

Changeset 7135

Show
Ignore:
Timestamp:
05/10/08 01:20:59 (2 months ago)
Author:
tschaub
Message:

a bit of style and the more generous proxy

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/examples/wfs-t.html

    r7132 r7135  
    22  <head> 
    33    <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; 
    915        } 
    1016    </style> 
     
    1319    <script type="text/javascript"> 
    1420        var map, wfs; 
    15         OpenLayers.ProxyHost= "proxy.cgi?url="; 
     21        OpenLayers.ProxyHost = "/proxy/?url="; 
    1622 
    1723        function init() { 
     
    3036                    typename: "tasmania_cities", 
    3137                    featureNS: "http://www.openplans.org/topp", 
    32                     extractAttributes: false 
     38                    extractAttributes: false, 
     39                    commitReport: function(str) { 
     40                        OpenLayers.Console.log(str); 
     41                    } 
    3342                } 
    3443            ); 
     
    4049            }); 
    4150 
    42             var dp = new OpenLayers.Control.DrawFeature( 
     51            var draw = new OpenLayers.Control.DrawFeature( 
    4352                wfs, OpenLayers.Handler.Point, 
    4453                { 
     
    4756                } 
    4857            ); 
     58             
     59            var save = new OpenLayers.Control.Button({ 
     60                trigger: OpenLayers.Function.bind(wfs.commit, wfs), 
     61                displayClass: "olControlSaveFeatures" 
     62            }); 
    4963 
    50             dp.featureAdded = function(feature) { 
     64            draw.featureAdded = function(feature) { 
    5165                var oldgeom = feature.geometry; 
    5266                feature.layer.renderer.eraseGeometry(oldgeom); 
     
    5771            
    5872            panel.addControls([ 
    59                 new OpenLayers.Control.Navigation(), dp 
     73                new OpenLayers.Control.Navigation(), 
     74                save, draw 
    6075            ]); 
    6176 
    6277            map.addControl(panel); 
    6378             
    64             map.zoomToExtent(new OpenLayers.Bounds(145.51045,-44.0,149.0,-40.5)); 
     79            map.zoomToExtent(new OpenLayers.Bounds(140.64,-44.42,151.89,-38.80)); 
    6580        } 
    6681         
     
    6984<body onload="init()"> 
    7085 
    71     <h1 id="title">WFS Example</h1> 
     86    <h1 id="title">WFS Transaction Example</h1> 
    7287     
    7388    <div id="tags"> 
    7489    </div> 
    7590    <p id="shortdesc"> 
    76         Shows the use of the WFS layer type
     91        Shows the use the WFS layer for transactions
    7792    </p> 
    7893     
    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> 
    8295     
    8396    <p id="docs">