[9139] | 1 | function init(){
|
---|
| 2 |
|
---|
| 3 | var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
|
---|
| 4 |
|
---|
| 5 | map = new OpenLayers.Map('heatmap', {
|
---|
| 6 | controls: [
|
---|
| 7 | new OpenLayers.Control.Navigation(),
|
---|
| 8 | new OpenLayers.Control.PanZoomBar(),
|
---|
| 9 | new OpenLayers.Control.ScaleLine(),
|
---|
| 10 | new OpenLayers.Control.LayerSwitcher(),
|
---|
| 11 | new OpenLayers.Control.MousePosition({ 'displayProjection' : projection_wgs }),
|
---|
| 12 | ],
|
---|
| 13 | maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892),
|
---|
| 14 | numZoomLevels:16,
|
---|
| 15 | maxResolution:156543.0339,
|
---|
| 16 | units:'m',
|
---|
| 17 | projection: "EPSG:900913",
|
---|
| 18 | displayProjection: new OpenLayers.Projection("EPSG:4326")
|
---|
| 19 | });
|
---|
| 20 |
|
---|
| 21 | layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
|
---|
| 22 | map.addLayer(layerMapnik);
|
---|
| 23 | layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Overlay 1", {isBaseLayer: false, visibility: true});
|
---|
| 24 | map.addLayer(layerHeatmap);
|
---|
[9147] | 25 |
|
---|
[9166] | 26 | layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("All Access points", {isBaseLayer: false, visibility: false});
|
---|
[9147] | 27 | map.addLayer(layerHeatmap2);
|
---|
[9166] | 28 |
|
---|
| 29 | layerHeatmap3 = new OpenLayers.Layer.OSM.Overlay3("Wireless Leiden Only", {isBaseLayer: false, visibility: true});
|
---|
| 30 | map.addLayer(layerHeatmap3);
|
---|
[9139] | 31 |
|
---|
| 32 | var lon = 4.48907;
|
---|
| 33 | var lat = 52.158431;
|
---|
| 34 | var zoom = 16;
|
---|
| 35 |
|
---|
| 36 | var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
|
---|
| 37 | map.setCenter (lonLat, zoom);
|
---|
| 38 | }
|
---|