convert IITC-only cookies to use localStorage instead - otherwise they're sent to the ingress servers and are a clear indentifier of IITC use (and wasteful of data too)

fix #251
This commit is contained in:
Jon Atkins
2013-05-10 04:40:21 +01:00
parent 35397c0c35
commit 3982c64b2f
2 changed files with 23 additions and 5 deletions

View File

@ -203,7 +203,8 @@ window.setupMap = function() {
// 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')]);
convertCookieToLocalStorage('ingress.intelmap.type');
map.addLayer(views[localStorage['ingress.intelmap.type']]);
} catch(e) { map.addLayer(views[0]); }
map.attributionControl.setPrefix('');
@ -228,7 +229,7 @@ window.setupMap = function() {
map.on('baselayerchange', function () {
var selInd = $('[name=leaflet-base-layers]:checked').parent().index();
writeCookie('ingress.intelmap.type', selInd);
localStorage['ingress.intelmap.type']=selInd;
});
// map update status handling