Changeset 9273 for src/django_gheat/website
- Timestamp:
- Jun 21, 2011, 1:19:10 PM (13 years ago)
- Location:
- src/django_gheat/website/static
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/OpenStreetMap.js
r9271 r9273 149 149 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 150 150 }, 151 151 SWITCHER_CLASS: "default", 152 152 CLASS_NAME: "OpenLayers.Layer.Overlay" 153 153 }); … … 162 162 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 163 163 }, 164 164 SWITCHER_COLOUR: "90,90,90", 165 SWITCHER_CLASS: "default", 165 166 CLASS_NAME: "OpenLayers.Layer.Overlay" 166 167 }); … … 175 176 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 176 177 }, 177 178 SWITCHER_COLOUR: "255,0,0", 179 SWITCHER_CLASS: "default", 178 180 CLASS_NAME: "OpenLayers.Layer.Overlay" 179 181 }); -
src/django_gheat/website/static/heatmap_extensions.js
r9272 r9273 65 65 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 66 66 }, 67 SWITCHER_CLASS: "signal", 67 68 CLASS_NAME: "OpenLayers.Layer.Overlay" 68 69 }); … … 78 79 testarray = map.getLayersByClass("OpenLayers.Layer.Overlay"); 79 80 $.each(testarray, function(v, value){ 80 $("#filter_text").append("<span id=\"" + value.name + "\"><input type=checkbox id=togglelayer />" + value.name + " <a style='color:#FF0000' id=rmvlayer name=\"" + value.name + "\">X</a><br /></span>"); 81 colour = value.SWITCHER_COLOUR; 82 $("#filter_text").append("<span id=\"" + value.name + "\"><input type=checkbox id=togglelayer /><font style='color:rgb(" + colour + ")'>" + value.name + " </font><a id=rmvlayer>X</a><br /></span>"); 81 83 }); 82 84 }); … … 89 91 }); 90 92 91 92 93 $("#rmvlayer").live("click", function(){ 93 $("#filter_text").append("<br />Removed " + this.name);94 layer = map.getLayersByName( this.name);95 console.log(rmvlayer);94 layername = $(this).parents('span').attr('id'); 95 layer = map.getLayersByName(layername); 96 $("#filter_text").append("<br />Removed " + layername); 96 97 map.removeLayer(layer[0]); 97 98 $(this).parents('span').remove(); … … 134 135 if(this.value=='Add userfilter'){ 135 136 $.each(userlist, function(u, user){ 136 colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);137 colour = Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256); 137 138 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, { 138 139 initialize: function(name, options) { 139 140 var url = [ 140 "/website/tile/${z}/${x},${y}.png? " + colour + "&meetrondje__gebruiker__naam=" + user141 "/website/tile/${z}/${x},${y}.png?&colour=" + colour + "&meetrondje__gebruiker__naam=" + user 141 142 ]; 142 143 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); … … 144 145 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 145 146 }, 147 SWITCHER_COLOUR: colour, 148 SWITCHER_CLASS: "user", 146 149 CLASS_NAME: "OpenLayers.Layer.Overlay" 147 150 }); … … 164 167 if(this.value=='Add nodefilter'){ 165 168 $.each(nodelist, function(n, node){ 166 colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);169 colour = Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256); 167 170 OpenLayers.Layer.OSM.Overlay = OpenLayers.Class(OpenLayers.Layer.OSM, { 168 171 initialize: function(name, options) { 169 172 var url = [ 170 "/website/tile/${z}/${x},${y}.png? " + colour + "&accespoint__ssid=" + node173 "/website/tile/${z}/${x},${y}.png?&colour=" + colour + "&accespoint__ssid=" + node 171 174 ]; 172 175 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); … … 174 177 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 175 178 }, 179 SWITCHER_COLOUR: colour, 180 SWITCHER_CLASS: "node", 176 181 CLASS_NAME: "OpenLayers.Layer.Overlay" 177 182 }); 178 183 nodefilterlayer = new OpenLayers.Layer.OSM.Overlay("Node: "+ node, {isBaseLayer: false, visibility: true}); 179 184 map.addLayer(nodefilterlayer); 185 console.log(nodefilterlayer); 180 186 }); 181 187 $(this).attr('value', 'Del nodefilter'); … … 235 241 end_date='&meetrondje__datum__lte=' + ed_y +'-'+ ed_m +'-'+ ed_d; 236 242 } 237 if (colour != 'NaN,NaN,NaN'){colour= 'colour='+colour;}238 else {colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);}243 if (colour != 'NaN,NaN,NaN'){colour=colour;} 244 else {colour = Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);} 239 245 if (lname != ''){lname=lname;} 240 246 else {lname = 'Custom Filter';} … … 244 250 initialize: function(name, options) { 245 251 var url = [ 246 "/website/tile/${z}/${x},${y}.png? " + colour + user + dataset + wlnode + start_date + end_date252 "/website/tile/${z}/${x},${y}.png?&colour=" + colour + user + dataset + wlnode + start_date + end_date 247 253 ]; 248 254 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); … … 250 256 OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments); 251 257 }, 258 SWITCHER_COLOURL: colour, 259 SWITCHER_CLASS: "custom", 252 260 CLASS_NAME: "OpenLayers.Layer.Overlay" 253 261 });
Note:
See TracChangeset
for help on using the changeset viewer.