mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-25 22:31:07 +02:00
Topo2: Added zoom callback to map service, to allow for adjusting map stroke-width on-the-fly.
Change-Id: I08f7bdda0b34c8e64a95a05d3c5af28fc236fe7d
This commit is contained in:
parent
ffaeac375e
commit
c43a59d2d5
@ -73,6 +73,9 @@
|
||||
offsetY: tr[1]
|
||||
};
|
||||
|
||||
// Allow map service to react to change in zoom parameters
|
||||
t2ms.zoomCallback(sc, tr);
|
||||
|
||||
// Note: Meta data stored in the context of the current layout,
|
||||
// automatically, by the server
|
||||
|
||||
|
||||
@ -97,6 +97,11 @@
|
||||
zoomer.reset();
|
||||
}
|
||||
|
||||
function zoomCallback(sc, tr) {
|
||||
// keep the map lines constant width while zooming
|
||||
this.node().style('stroke-width', (2.0 / sc) + 'px');
|
||||
}
|
||||
|
||||
angular.module('ovTopo2')
|
||||
.factory('Topo2MapService', [
|
||||
'$log', '$location', 'Topo2ViewController', 'PrefsService',
|
||||
@ -126,7 +131,8 @@
|
||||
setMap: setMap,
|
||||
setUpMap: setUpMap,
|
||||
openMapSelection: openMapSelection,
|
||||
resetZoom: resetZoom
|
||||
resetZoom: resetZoom,
|
||||
zoomCallback: zoomCallback
|
||||
});
|
||||
|
||||
return instance || new MapLayer();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user