diff options
author | Antoine Beaupré <anarcat@koumbit.org> | 2012-08-09 01:07:20 -0400 |
---|---|---|
committer | Antoine Beaupré <anarcat@koumbit.org> | 2012-08-25 08:20:30 -0400 |
commit | acc4d7d7d65ed9519fa9b5fca7c878f3e9a31451 (patch) | |
tree | e64f4c3ebb17adf5090f55362195ab28aa756bc4 /underlays | |
parent | b57cad3131218c7d1a027a60c71ede74f0f14829 (diff) | |
download | ikiwiki-acc4d7d7d65ed9519fa9b5fca7c878f3e9a31451.tar ikiwiki-acc4d7d7d65ed9519fa9b5fca7c878f3e9a31451.tar.gz |
osm: add optional google maps support
for google maps to work, an API key needs to be added to the configuration
Diffstat (limited to 'underlays')
-rw-r--r-- | underlays/osm/ikiwiki/osm.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/underlays/osm/ikiwiki/osm.js b/underlays/osm/ikiwiki/osm.js index 388d625f1..9269bd899 100644 --- a/underlays/osm/ikiwiki/osm.js +++ b/underlays/osm/ikiwiki/osm.js @@ -34,6 +34,10 @@ function mapsetup(divname, options) { new OpenLayers.Control.Permalink(permalink) ], displayProjection: new OpenLayers.Projection("EPSG:4326"), + maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), + projection: "EPSG:900913", + units: "m", + maxResolution: 156543.0339, numZoomLevels: 18 }); @@ -44,6 +48,17 @@ function mapsetup(divname, options) { map.addLayer(new OpenLayers.Layer.OSM()); } + // this nightmare is possible through http://docs.openlayers.org/library/spherical_mercator.html + if (options.google_apikey && options.google_apikey != 'null') { + googleLayer = new OpenLayers.Layer.Google( + "Google Hybrid", + {type: G_HYBRID_MAP, + 'sphericalMercator': true, + 'maxExtent': new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), + projection: new OpenLayers.Projection("EPSG:3857")} + ); + map.addLayer(googleLayer); + } if (options.format == 'CSV') { pois = new OpenLayers.Layer.Text( "CSV", { location: options.csvurl, |