Merge the excellent documentation work done during foss4g into trunk. Many
thanks to all the contributors who helped put this together. I'm not exactly sure of what's going to happen with this, but for now, at http://openlayers.org/dev/doc/examples.html you can see links to all the examples *with descriptions*. Hooray! git-svn-id: http://svn.openlayers.org/trunk/openlayers@5362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+44
-26
@@ -2,8 +2,8 @@
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
@@ -13,57 +13,75 @@
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.WMS( "State",
|
||||
layer = new OpenLayers.Layer.WMS( "State",
|
||||
"http://dev.openlayers.org/geoserver/wms", {layers: 'topp:tasmania_state_boundaries'} );
|
||||
map.addLayer(layer);
|
||||
layer = new OpenLayers.Layer.WMS( "Water",
|
||||
layer = new OpenLayers.Layer.WMS( "Water",
|
||||
"http://dev.openlayers.org/geoserver/wms", {layers: 'topp:tasmania_water_bodies', 'transparent': true, format: 'image/gif' } );
|
||||
map.addLayer(layer);
|
||||
rlayer = new OpenLayers.Layer.WFS( "Roads",
|
||||
rlayer = new OpenLayers.Layer.WFS( "Roads",
|
||||
"http://dev.openlayers.org/geoserver/wfs", {typename: 'topp:tasmania_roads'},
|
||||
{
|
||||
typename: 'tasmania_roads',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
{
|
||||
typename: 'tasmania_roads',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
extractAttributes: false
|
||||
} );
|
||||
rlayer.onFeatureInsert=function(feature) { feature.style.strokeColor = "#ff0000"; feature.layer.drawFeature(feature); }
|
||||
map.addLayer(rlayer);
|
||||
layer = new OpenLayers.Layer.WFS( "Cities",
|
||||
"http://dev.openlayers.org/geoserver/wfs", {typename: 'topp:tasmania_cities'},
|
||||
{
|
||||
typename: 'tasmania_cities',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
layer = new OpenLayers.Layer.WFS( "Cities",
|
||||
"http://dev.openlayers.org/geoserver/wfs", {typename: 'topp:tasmania_cities'},
|
||||
{
|
||||
typename: 'tasmania_cities',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
extractAttributes: false
|
||||
} );
|
||||
map.addLayer(layer);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
var p = new OpenLayers.Control.Panel({'displayClass': 'olControlEditingToolbar'});
|
||||
|
||||
|
||||
df = new OpenLayers.Control.DrawFeature(rlayer, OpenLayers.Handler.Path, {handlerOptions: {'freehand': false}, 'displayClass': 'olControlDrawFeaturePath'});
|
||||
df.featureAdded = function(feature) {
|
||||
feature.state = OpenLayers.State.INSERT;
|
||||
feature.style['strokeColor'] = "#0000ff";
|
||||
feature.layer.drawFeature(feature);
|
||||
df.featureAdded = function(feature) {
|
||||
feature.state = OpenLayers.State.INSERT;
|
||||
feature.style['strokeColor'] = "#0000ff";
|
||||
feature.layer.drawFeature(feature);
|
||||
}
|
||||
dp = new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Point, {handlerOptions: {'freehand': false}, 'displayClass': 'olControlDrawFeaturePoint'});
|
||||
dp.featureAdded = function(feature) {
|
||||
dp.featureAdded = function(feature) {
|
||||
var oldgeom = feature.geometry;
|
||||
feature.layer.renderer.eraseGeometry(oldgeom);
|
||||
feature.geometry = new OpenLayers.Geometry.MultiPoint(oldgeom);
|
||||
feature.state = OpenLayers.State.INSERT;
|
||||
feature.style['strokeColor'] = "#0000ff";
|
||||
feature.layer.drawFeature(feature);
|
||||
feature.state = OpenLayers.State.INSERT;
|
||||
feature.style['strokeColor'] = "#0000ff";
|
||||
feature.layer.drawFeature(feature);
|
||||
}
|
||||
p.addControls([ new OpenLayers.Control.Navigation(), df, dp ]);
|
||||
|
||||
|
||||
map.addControl(p);
|
||||
map.zoomToExtent(new OpenLayers.Bounds(145.51045,-44.0,149.0,-40.5));
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<a href="#" onclick="map.layers[2].commit();return false">Save Roads</a><br />
|
||||
<a href="#" onclick="map.layers[3].commit();return false">Save Cities</a><br />
|
||||
<div id="map"></div>
|
||||
|
||||
<h1 id="title">WFS Example</h1>
|
||||
|
||||
<div id="tags">
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
Shows the use of the WFS layer type.
|
||||
</p>
|
||||
|
||||
<a href="#" onclick="map.layers[2].commit();return false">Save Roads</a><br />
|
||||
<a href="#" onclick="map.layers[3].commit();return false">Save Cities</a><br />
|
||||
<div id="map"></div>
|
||||
|
||||
<div id="docs">
|
||||
This is an example of using a WFS layer type.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user