Changeset 9264 for src/django_gheat/website/static/heatmap.js
- Timestamp:
- Jun 16, 2011, 5:02:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/website/static/heatmap.js
r9263 r9264 2 2 function init(){ 3 3 4 var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984 4 var lat = 52.14068; 5 var lon = 4.48319; 6 var zoom = 16; 7 var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984 5 8 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 9 map = new OpenLayers.Map('heatmap', { 10 controls: [ 11 new OpenLayers.Control.Navigation(), 12 //new OpenLayers.Control.PanZoomBar(), 13 //new OpenLayers.Control.ScaleLine(), 14 new OpenLayers.Control.Permalink(), 15 new OpenLayers.Control.LayerSwitcher(), 16 new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs }), 17 ], 18 maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892), 19 numZoomLevels:16, 20 maxResolution:156543.0339, 21 units:'m', 22 projection: "EPSG:900913", 23 displayProjection: new OpenLayers.Projection("EPSG:4326") 24 }); 22 25 23 24 25 26 27 28 29 26 map.events.register('click', map, GetMousePos); 27 function GetMousePos(pos) { 28 var pix = map.getLonLatFromPixel(new OpenLayers.Pixel(pos.xy.x,pos.xy.y)); 29 var mousepos = OpenLayers.Layer.SphericalMercator.inverseMercator(pix.lon, pix.lat); 30 var zoomlevel = map.getZoom(); 31 getNodeList(zoom, mousepos); 32 } 30 33 31 32 34 layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); 35 map.addLayer(layerMapnik); 33 36 34 35 37 layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: true}); 38 map.addLayer(layerHeatmap2); 36 39 37 38 40 layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Only", {isBaseLayer: false, visibility: true}); 41 map.addLayer(layerHeatmap3); 39 42 40 41 43 layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Original Heatmap generator", {isBaseLayer: false, visibility: false}); 44 map.addLayer(layerHeatmap); 42 45 43 var lon = 4.48319; 44 var lat = 52.14068; 45 var zoom = 16; 46 47 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 48 map.setCenter (lonLat, zoom); 46 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 47 map.setCenter (lonLat, zoom); 49 48 }
Note:
See TracChangeset
for help on using the changeset viewer.