This commit is contained in:
Stefan Breunig 2013-02-25 08:15:24 +01:00
parent f213a481e8
commit 9782883b5c

View File

@ -58,10 +58,6 @@ window.setupMap = function() {
{zoomControl: !(localStorage['iitc.zoom.buttons'] === 'false')} {zoomControl: !(localStorage['iitc.zoom.buttons'] === 'false')}
)); ));
try {
map.addLayer(views[readCookie('ingress.intelmap.type')]);
} catch(e) { map.addLayer(views[0]); }
var addLayers = {}; var addLayers = {};
portalsLayers = []; portalsLayers = [];
@ -91,6 +87,14 @@ window.setupMap = function() {
}, addLayers); }, addLayers);
map.addControl(window.layerChooser); map.addControl(window.layerChooser);
// set the map AFTER adding the layer chooser, or Chrome reorders the
// layers. This likely leads to broken layer selection because the
// views/cookie order does not match the layer chooser order.
try {
map.addLayer(views[readCookie('ingress.intelmap.type')]);
} catch(e) { map.addLayer(views[0]); }
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);