Changeset 9599
- Timestamp:
- Aug 28, 2011, 4:02:40 PM (13 years ago)
- Location:
- src/django_gheat/wlheatmap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/static/heatmap.js
r9596 r9599 57 57 map.addLayer(layerMapnik); 58 58 59 layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: false});60 //map.addLayer(layerHeatmap2);61 62 signallayer = new OpenLayers.Layer.OSM.Overlay4("signallayer", {isBaseLayer: false, visibility: false});63 map.addLayer(signallayer);64 65 layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Coverage", {isBaseLayer: false, visibility: true});66 map.addLayer(layerHeatmap3);67 68 layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Original Heatmap generator", {isBaseLayer: false, visibility: false});69 //map.addLayer(layerHeatmap);70 71 var nodesLayer = new OpenLayers.Layer.GML.NodesOverlay("Node Locations", "feature/nodes.json", {isBaseLayer: false, visibility: true});72 map.addLayer(nodesLayer);73 74 59 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 75 60 map.setCenter (lonLat, zoom); … … 77 62 78 63 /** 79 * Layers above are put in switcher, category 'default', with code below. 80 * TODO: Make process for putting layers into layerswitcher dynamic instead of putting every layer there manually. 64 * Layers are created and put in switcher 81 65 */ 66 function add_item(category, layer) { 67 map.addLayer(layer); 68 var checked = ''; 69 if (layer.getVisibility()) { checked = "checked='checked'"; }; 70 $("#" + category).append("<span id=\"" + layer.name + "\">" + 71 " <div id='layer_switcher_colour' style='background-color:rgb(" + layer.colour + ")' />" + 72 "<input type='checkbox' id='togglelayer' " + checked + " /><font>" + layer.name + " </font><br /></span>" 73 ); 74 } 82 75 83 //$("#default").append("<span id=\"" + layerHeatmap.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap.name + " </font><br /></span>"); 76 var signallayer = new OpenLayers.Layer.OSM.Overlay4("signallayer", {isBaseLayer: false, visibility: false}); 77 var wlsignalLayer = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Coverage", {isBaseLayer: false, visibility: true}); 78 var nodesLayer = new OpenLayers.Layer.GML.NodesOverlay("Node Locations", {isBaseLayer: false, visibility: false}); 84 79 85 //$("#default").append("<span id=\"" + layerHeatmap2.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap2.colour + ")' /><input type=checkbox id=togglelayer /><font>" + layerHeatmap2.name + " </font><br /></span>"); 86 87 $("#default").append("<span id=\"" + signallayer.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + signallayer.colour + ")' /><input type=checkbox id=togglelayer /><font>Replaced during init</font><br /></span>"); 88 89 $("#default").append("<span id=\"" + layerHeatmap3.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap3.colour + ")' /><input type=checkbox id=togglelayer checked/><font>" + layerHeatmap3.name + " </font><br /></span>"); 90 91 $("#features").append("<span id=\"" + nodesLayer.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + nodesLayer.colour + ")' /><input type=checkbox id=togglelayer checked/><font>" + nodesLayer.name + " </font><br /></span>"); 92 80 add_item('default', signallayer); 81 add_item('default', wlsignalLayer); 82 add_item('features', nodesLayer); 93 83 } -
src/django_gheat/wlheatmap/templates/home.html
r9584 r9599 98 98 <div id="layer_switcher_cat"> 99 99 <div id="cat_hide"></div> 100 <input type=checkbox id=togglecat class= custom checked/>Features100 <input type=checkbox id=togglecat class=features />Features 101 101 </div><p><span id="features"></span></p> 102 102 </div>
Note:
See TracChangeset
for help on using the changeset viewer.