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

Last change on this file since 9142 was 9139, checked in by dennisw, 15 years ago

Structure overhaul part 2; added website folder with the template, changes to urls.py and settings.py.

File size: 1.1 KB
Line 
1function 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 var lon = 4.48907;
27 var lat = 52.158431;
28 var zoom = 16;
29
30 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
31 map.setCenter (lonLat, zoom);
32}
Note: See TracBrowser for help on using the repository browser.