1 | var map;
|
---|
2 | function init(){
|
---|
3 |
|
---|
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
|
---|
8 |
|
---|
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 | });
|
---|
25 |
|
---|
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 | }
|
---|
33 |
|
---|
34 | layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
---|
35 | map.addLayer(layerMapnik);
|
---|
36 |
|
---|
37 | layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: true});
|
---|
38 | map.addLayer(layerHeatmap2);
|
---|
39 |
|
---|
40 | layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Only", {isBaseLayer: false, visibility: true});
|
---|
41 | map.addLayer(layerHeatmap3);
|
---|
42 |
|
---|
43 | layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Original Heatmap generator", {isBaseLayer: false, visibility: false});
|
---|
44 | map.addLayer(layerHeatmap);
|
---|
45 |
|
---|
46 | var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
|
---|
47 | map.setCenter (lonLat, zoom);
|
---|
48 | }
|
---|