Simon Hunt

GUI -- TopoView : Remember the zoom level..

Change-Id: Id607a94a651121cf2c988c80360a752d28727bae
...@@ -206,7 +206,10 @@ ...@@ -206,7 +206,10 @@
206 } 206 }
207 207
208 function zoomCallback() { 208 function zoomCallback() {
209 - var sc = zoomer.scale(); 209 + var sc = zoomer.scale(),
210 + tr = zoomer.translate();
211 +
212 + ps.setPrefs('topo_zoom', {tx:tr[0], ty:tr[1], sc:sc});
210 213
211 // keep the map lines constant width while zooming 214 // keep the map lines constant width while zooming
212 mapG.style('stroke-width', (2.0 / sc) + 'px'); 215 mapG.style('stroke-width', (2.0 / sc) + 'px');
...@@ -374,8 +377,12 @@ ...@@ -374,8 +377,12 @@
374 setUpNoDevs(); 377 setUpNoDevs();
375 setUpMap().then( 378 setUpMap().then(
376 function (proj) { 379 function (proj) {
380 + var z = ps.getPrefs('topo_zoom') || {tx:0, ty:0, sc:1};
381 + zoomer.panZoom([z.tx, z.ty], z.sc);
382 + $log.debug('** Zoom restored:', z);
383 +
377 projection = proj; 384 projection = proj;
378 - $log.debug('** We installed the projection: ', proj); 385 + $log.debug('** We installed the projection:', proj);
379 flash.enable(false); 386 flash.enable(false);
380 toggleMap(prefsState.bg); 387 toggleMap(prefsState.bg);
381 flash.enable(true); 388 flash.enable(true);
......