make layerChooser available to plugins so they can add layers of their own

This commit is contained in:
Stefan Breunig
2013-02-13 17:44:41 +01:00
parent cf17fef699
commit 1e6161ad2e

View File

@ -83,7 +83,7 @@ window.setupMap = function() {
map.addLayer(linksLayer, true); map.addLayer(linksLayer, true);
addLayers['Links'] = linksLayer; addLayers['Links'] = linksLayer;
map.addControl(new L.Control.Layers({ window.layerChooser = new L.Control.Layers({
'OSM Cloudmade Midnight': views[0], 'OSM Cloudmade Midnight': views[0],
'OSM Cloudmade Minimal': views[1], 'OSM Cloudmade Minimal': views[1],
'OSM Mapnik': views[2], 'OSM Mapnik': views[2],
@ -91,7 +91,9 @@ window.setupMap = function() {
'Google Roads': views[4], 'Google Roads': views[4],
'Google Satellite': views[5], 'Google Satellite': views[5],
'Google Hybrid': views[6] 'Google Hybrid': views[6]
}, addLayers)); }, addLayers);
map.addControl(window.layerChooser);
map.attributionControl.setPrefix(''); map.attributionControl.setPrefix('');
// listen for changes and store them in cookies // listen for changes and store them in cookies
map.on('moveend', window.storeMapPosition); map.on('moveend', window.storeMapPosition);