@@ -323,6 +323,16 @@ var baseMaps = {
323323
324324var selectedLayer = "Mapnik" ;
325325
326+ // set map if in memory
327+ var maplayer = offline . get ( "map" )
328+ if ( maplayer !== null ) {
329+ if ( baseMaps . hasOwnProperty ( maplayer ) ) {
330+ selectedLayer = maplayer ;
331+ }
332+ }
333+
334+ console . log ( selectedLayer ) ;
335+
326336// mousemove event throttle hack for smoother maps pan on firefox and IE
327337// taken from: http://stackoverflow.com/questions/22306130/how-to-limit-google-maps-api-lag-when-panning-the-map-with-lots-of-markers-and-p
328338
@@ -437,7 +447,7 @@ function load() {
437447 zoomControl : false ,
438448 zoomAnimationThreshold : 0 ,
439449 center : [ 53.467511 , - 2.233894 ] ,
440- layers : baseMaps [ "Mapnik" ] ,
450+ layers : baseMaps [ selectedLayer ] ,
441451 preferCanvas : true ,
442452 } ) ;
443453
@@ -526,6 +536,7 @@ function load() {
526536
527537 map . on ( 'baselayerchange' , function ( e ) {
528538 selectedLayer = e . layer . id ;
539+ offline . set ( 'map' , selectedLayer ) ;
529540 } ) ;
530541
531542 map . on ( 'zoomend' , function ( ) {
@@ -563,6 +574,7 @@ function load() {
563574
564575 // only start population the map, once its completely loaded
565576 var callBack = function ( ) {
577+
566578 load_hash ( null ) ;
567579 map . options . zoomAnimationThreshold = 4 ;
568580
@@ -3663,7 +3675,6 @@ function refreshPredictions() {
36633675 data : "" ,
36643676 dataType : "json" ,
36653677 success : function ( response , textStatus ) {
3666- offline . set ( 'predictions' , "" ) ;
36673678 updatePredictions ( response ) ;
36683679 } ,
36693680 error : function ( ) {
0 commit comments