Changeset 9544 for src/django_gheat/wlheatmap
- Timestamp:
- Aug 23, 2011, 10:11:58 AM (13 years ago)
- Location:
- src/django_gheat/wlheatmap
- Files:
-
- 1 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/wlheatmap/__init__.py
r9139 r9544 1 from django.shortcuts import render_to_response 2 from django.conf import settings 3 4 def js_layer_base(request): 5 return render_to_response('js/LayerBase.js', {'settings' : settings }, 6 mimetype='application/javascript') -
src/django_gheat/wlheatmap/templates/home.html
r9407 r9544 5 5 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}jquery-1.6.2.min.js"></script> 6 6 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}OpenLayers.js"></script> 7 <script type="text/javascript" language="Javascript" src="{ { STATIC_URL }}OpenStreetMap.js"></script>7 <script type="text/javascript" language="Javascript" src="{% url wlheatmap.js_layer_base %}"></script> 8 8 <script type="text/javascript" language="Javascript" src="{{ STATIC_URL }}heatmap.js"></script> 9 9 <script type="text/javascript" language="javascript" src="{{ STATIC_URL }}jquery.chained.js"></script> -
src/django_gheat/wlheatmap/templates/js/LayerBase.js
r9543 r9544 29 29 }; 30 30 31 var wl_balancers = ['a','b','c','d','e','f'];32 31 function get_balanced_urls(prefix, balancers, suffix) { 33 32 var urls = []; 34 for ( i=0; i < balancers.length; i++) {33 for (var i=0; i < balancers.length; i++) { 35 34 urls.push(prefix + balancers[i] + suffix); 36 35 }; … … 39 38 40 39 40 41 41 /** 42 42 * Class: OpenLayers.Layer.OSM.Mapnik … … 54 54 */ 55 55 initialize: function(name, options) { 56 var url = get_balanced_urls('http://', wl_balancers, '.osmproxy.wirelessleiden.nl/heatmap/osm-proxy/${z}/${x},${y}.png');56 var url = get_balanced_urls('http://', {{ settings.OSM_PROXY_CDN_DOMAINS|safe }}, '{{ settings.DJANGO_PREFIX }}/osm-proxy/${z}/${x},${y}.png'); 57 57 options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options); 58 58 var newArguments = [name, url, options]; … … 168 168 OpenLayers.Layer.OSM.Overlay2 = OpenLayers.Class(OpenLayers.Layer.OSM, { 169 169 initialize: function(name, options) { 170 var url = get_balanced_urls('http://', wl_balancers, '.maps.wirelessleiden.nl/wlheatmap/tile/${z}/${x},${y}.png?colour=90,90,90');170 var url = get_balanced_urls('http://', {{ settings.DJANGO_CDN_DOMAINS|safe }}, '{{ settings.DJANGO_PREFIX }}/wlheatmap/tile/${z}/${x},${y}.png?colour=90,90,90'); 171 171 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); 172 172 var newArguments = [name, url, options]; … … 182 182 OpenLayers.Layer.OSM.Overlay3 = OpenLayers.Class(OpenLayers.Layer.OSM, { 183 183 initialize: function(name, options) { 184 var url = get_balanced_urls('http://', wl_balancers, '.maps.wirelessleiden.nl/wlheatmap/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden');184 var url = get_balanced_urls('http://', {{ settings.DJANGO_CDN_DOMAINS|safe }}, '{{ settings.DJANGO_PREFIX }}/wlheatmap/tile/${z}/${x},${y}.png?colour=255,0,0&accespoint__ssid__icontains=WirelessLeiden'); 185 185 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); 186 186 var newArguments = [name, url, options]; … … 196 196 OpenLayers.Layer.OSM.Overlay4 = OpenLayers.Class(OpenLayers.Layer.OSM, { 197 197 initialize: function(name, options) { 198 var url = get_balanced_urls('http://', wl_balancers, '.maps.wirelessleiden.nl/wlheatmap/tile/${z}/${x},${y}.png?colour=50,150,50&signaal__gte=0&signaal__lte=100');198 var url = get_balanced_urls('http://', {{ settings.DJANGO_CDN_DOMAINS|safe }}, '{{ settings.DJANGO_PREFIX }}/wlheatmap/tile/${z}/${x},${y}.png?colour=50,150,50&signaal__gte=0&signaal__lte=100'); 199 199 options = OpenLayers.Util.extend({ numZoomLevels: 21 }, options); 200 200 var newArguments = [name, url, options]; -
src/django_gheat/wlheatmap/urls.py
r9390 r9544 13 13 urlpatterns = patterns('wlheatmap', 14 14 url(r'^$', direct_to_template, {'template' : 'home.html'}), 15 url(r'^js/LayerBase.js$', 'js_layer_base'), 15 16 url(r'^tile/(?P<zoom>\d+)/(?P<x>\d+),(?P<y>\d+).png$', 'tile.serve_tile'), 16 17 url(r'^nodelist/(?P<zoom>\d+),(?P<lat>[0-9.]+),(?P<lon>[0-9.]+)$', 'nodelist.serve_nodelist'),
Note:
See TracChangeset
for help on using the changeset viewer.