[9203] | 1 | var map;
|
---|
[9139] | 2 | function 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(),
|
---|
[9210] | 9 | //new OpenLayers.Control.PanZoomBar(),
|
---|
| 10 | //new OpenLayers.Control.ScaleLine(),
|
---|
[9139] | 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 | });
|
---|
[9175] | 21 |
|
---|
[9203] | 22 | map.events.register('click', map, GetMousePos);
|
---|
[9175] | 23 | function GetMousePos(pos) {
|
---|
[9196] | 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);
|
---|
[9175] | 28 | }
|
---|
| 29 |
|
---|
[9139] | 30 | layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
---|
| 31 | map.addLayer(layerMapnik);
|
---|
[9147] | 32 |
|
---|
[9177] | 33 | layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: true});
|
---|
[9147] | 34 | map.addLayer(layerHeatmap2);
|
---|
[9166] | 35 |
|
---|
| 36 | layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Only", {isBaseLayer: false, visibility: true});
|
---|
| 37 | map.addLayer(layerHeatmap3);
|
---|
[9190] | 38 |
|
---|
| 39 | layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Original Heatmap generator", {isBaseLayer: false, visibility: false});
|
---|
| 40 | map.addLayer(layerHeatmap);
|
---|
[9139] | 41 |
|
---|
[9197] | 42 | var lon = 4.48319;
|
---|
| 43 | var lat = 52.14068;
|
---|
[9139] | 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 | }
|
---|