source: src/django_gheat/samples/persisted/static/heatmap.js@ 9113

Last change on this file since 9113 was 9113, checked in by dennisw, 14 years ago

Supports OpenLayers/OpenStreetMap instead of Google Maps.

File size: 954 bytes
Line 
1function init(){
2 map = new OpenLayers.Map('heatmap', {
3 controls: [
4 new OpenLayers.Control.Navigation(),
5 new OpenLayers.Control.PanZoomBar(),
6 new OpenLayers.Control.ScaleLine(),
7 new OpenLayers.Control.LayerSwitcher()
8 ],
9 maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892),
10 numZoomLevels:16,
11 maxResolution:156543.0339,
12 units:'m',
13 projection: "EPSG:900913",
14 displayProjection: new OpenLayers.Projection("EPSG:4326")
15 });
16
17 layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
18 map.addLayer(layerMapnik);
19 layerHeatmap = new OpenLayers.Layer.OSM.Overlay1("Overlay 1", {isBaseLayer: false, visibility: true});
20 map.addLayer(layerHeatmap);
21
22 var lon = 4.4585017;
23 var lat = 52.1406583;
24 var zoom = 13;
25
26 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
27 map.setCenter (lonLat, zoom);
28}
Note: See TracBrowser for help on using the repository browser.