source: src/django_gheat/website/static/heatmap.js@ 9222

Last change on this file since 9222 was 9210, checked in by dennisw, 13 years ago

Playing with interface.

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