[OpenLayers-Commits] r4806 - sandbox/ahocevar/sldRenderer/examples

commits at openlayers.org commits at openlayers.org
Thu Oct 4 03:35:58 EDT 2007


Author: adjioev
Date: 2007-10-04 03:35:57 -0400 (Thu, 04 Oct 2007)
New Revision: 4806

Added:
   sandbox/ahocevar/sldRenderer/examples/gml-tasmania-layer-sld.html
Log:
gml tasmania page for filter testing.

Added: sandbox/ahocevar/sldRenderer/examples/gml-tasmania-layer-sld.html
===================================================================
--- sandbox/ahocevar/sldRenderer/examples/gml-tasmania-layer-sld.html	                        (rev 0)
+++ sandbox/ahocevar/sldRenderer/examples/gml-tasmania-layer-sld.html	2007-10-04 07:35:57 UTC (rev 4806)
@@ -0,0 +1,76 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <style type="text/css">
+        #map {
+            width: 800px;
+            height: 475px;
+            border: 1px solid black;
+        }
+    </style>
+	<script src="../lib/Firebug/firebug.js"></script>
+    <script src="../lib/OpenLayers.js"></script>
+    <script type="text/javascript">
+        var lon = 5;
+        var lat = 40;
+        var zoom = 5;
+        var map, layer, hover;
+
+        function load(){
+           OpenLayers.loadURL("xml/sld-tasmania.xml", "", null, init);
+        }
+        
+        function init(req){
+            map = new OpenLayers.Map('map');
+            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
+                    "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
+            sld = (new OpenLayers.Format.SLD()).read(req.responseText);
+            map.addLayer(layer);           
+			// map.zoomToExtent(new OpenLayers.Bounds(-3.922119,44.335327,4.866943,49.553833));
+			map.zoomToExtent(new OpenLayers.Bounds(141.2160679,-37.87454343,152.2160679,-45.87454343));
+            gmlLayer = null;
+			addGmlLayer("Default Styler");
+        }
+        
+        function addGmlLayer(styleName) {
+        	if (gmlLayer) {
+        		hover.deactivate();
+        		hover.destroy();
+        		map.removeLayer(gmlLayer);
+        		gmlLayer.destroy();
+        	}
+			
+		
+			gmlLayerContext = new OpenLayers.Layer.GML("GML", "tasmania/TasmaniaContext.xml", {style: sld[styleName]});
+            gmlLayerStates = new OpenLayers.Layer.GML("GML", "tasmania/TasmaniaStateBoundaries.xml", {style: sld[styleName]});
+            gmlLayerRoads = new OpenLayers.Layer.GML("GML", "tasmania/TasmaniaRoads.xml", {style: sld[styleName]});
+			gmlLayerSld = new OpenLayers.Layer.GML("GML", "tasmania/TasmaniaSld.xml", {style: sld[styleName]});
+			gmlLayerWaterBodies = new OpenLayers.Layer.GML("GML", "tasmania/TasmaniaWaterBodies.xml", {style: sld[styleName]});
+
+		
+			map.addLayer(gmlLayerStates);
+			map.addLayer(gmlLayerRoads);
+			map.addLayer(gmlLayerWaterBodies);
+			map.addLayer(gmlLayerSld);			
+			map.addLayer(gmlLayerContext);
+
+			
+            hover = new OpenLayers.Control.SelectFeature(gmlLayerWaterBodies,
+            		{hover: true,
+            		 selectStyle: sld["Hover Styler"]});
+            map.addControl(hover);
+            hover.activate();
+        }
+    </script>
+  </head>
+  <body onload="load()">
+    <div id="map"></div>
+    <form>
+        <input type="radio" name="style" onclick="addGmlLayer(this.value)" checked="checked" value="Default Styler">Default Styler (zoom in to see more features)</input><br/>
+        <input type="radio" name="style" onclick="addGmlLayer(this.value)" value="Attribute Filter Styler">Attribute Filter Styler</input>	<br/>
+	    <input type="radio" name="style" onclick="addGmlLayer(this.value)" value="Styler Test FID">Styler Test FID</input><br/>
+		    <input type="radio" name="style" onclick="addGmlLayer(this.value)" value="Styler Test WATER_TYPE">Styler Test1 WATER_TYPE</input><br/>
+			    <input type="radio" name="style" onclick="addGmlLayer(this.value)" value="Styler Test PropertyIsGreaterThanOrEqualTo">Styler Test PropertyIsGreaterThanOrEqualTo</input><br/>
+			
+    </form>
+  </body>
+</html>



More information about the Commits mailing list