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);
|
---|
25 |
|
---|
26 | layerHeatmap2 = new OpenLayers.Layer.OSM.Overlay2("Overlay 2", {isBaseLayer: false, visibility: false});
|
---|
27 | map.addLayer(layerHeatmap2);
|
---|
28 |
|
---|
29 | var lon = 4.48907;
|
---|
30 | var lat = 52.158431;
|
---|
31 | var zoom = 16;
|
---|
32 |
|
---|
33 | var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
|
---|
34 | map.setCenter (lonLat, zoom);
|
---|
35 | }
|
---|