From a63370cae98528e4360b6f7593525e3c5a6f8b38 Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Wed, 13 Feb 2013 19:52:29 +0100 Subject: [PATCH] fix Leaflet not saving base layer properly --- code/boot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/boot.js b/code/boot.js index 44aeb3a2..e0397ebe 100644 --- a/code/boot.js +++ b/code/boot.js @@ -113,8 +113,10 @@ window.setupMap = function() { console.log('Remove all resonators'); }); - $("[name='leaflet-base-layers']").change(function () { - writeCookie('ingress.intelmap.type', $(this).parent().index()); + + map.on('baselayerchange', function () { + var selInd = $('[name=leaflet-base-layers]:checked').parent().index(); + writeCookie('ingress.intelmap.type', selInd); }); // map update status handling