1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>All Overlays Example</title>
5 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
6 <link rel="stylesheet" href="style.css" type="text/css" />
7 <script src="../lib/OpenLayers.js"></script>
8 <script type="text/javascript">
11 map = new OpenLayers.Map({
14 maxExtent: new OpenLayers.Bounds(
15 1549471.9221, 6403610.94, 1550001.32545, 6404015.8
19 // give the features some style
20 var styles = new OpenLayers.StyleMap({
25 strokeColor: "#0099cc",
30 // add rules from the above lookup table
31 styles.addUniqueValueRules("default", "RP_TYPE", {
32 10: {strokeColor: "#000000", strokeWidth: 2},
33 12: {strokeColor: "#222222", strokeWidth: 2},
34 14: {strokeColor: "#444444", strokeWidth: 2},
35 16: {strokeColor: "#666666", strokeWidth: 2},
36 18: {strokeColor: "#888888", strokeWidth: 2},
37 19: {strokeColor: "#666666", strokeWidth: 1}
40 var vectors = new OpenLayers.Layer.Vector("Lines", {
41 strategies: [new OpenLayers.Strategy.Fixed()],
42 protocol: new OpenLayers.Protocol.HTTP({
43 url: "data/roads.json",
44 format: new OpenLayers.Format.GeoJSON()
49 map.addLayer(vectors);
50 map.addControl(new OpenLayers.Control.LayerSwitcher());
51 map.zoomToMaxExtent();
57 <body onload="init()">
58 <h1 id="title">OpenLayers Overlays Only Example</h1>
60 Demonstrates a map with overlays only.
62 <div id="map" class="smallmap"></div>
64 To create a map that allows any draw order with all layer types
65 and lets you set the visibility of any layer independently, set
66 the allOverlays property on the map to true.