GUI2 added method to zoom to map size

Change-Id: I3aa578b78ebe2ab26f72a7535b8b5e9e0a822cb6
diff --git a/web/gui2/src/main/webapp/app/view/topology/layer/forcesvg/forcesvg.component.ts b/web/gui2/src/main/webapp/app/view/topology/layer/forcesvg/forcesvg.component.ts
index 7b66f36..ebc70aa 100644
--- a/web/gui2/src/main/webapp/app/view/topology/layer/forcesvg/forcesvg.component.ts
+++ b/web/gui2/src/main/webapp/app/view/topology/layer/forcesvg/forcesvg.component.ts
@@ -28,7 +28,13 @@
     SimpleChanges,
     ViewChildren
 } from '@angular/core';
-import {LogService, WebSocketService} from 'gui2-fw-lib';
+import {
+    LocMeta,
+    LogService,
+    MetaUi,
+    WebSocketService,
+    ZoomUtils
+} from 'gui2-fw-lib';
 import {
     Device,
     ForceDirectedGraph,
@@ -38,8 +44,7 @@
     LayerType,
     Link,
     LinkHighlight,
-    Location, LocMeta,
-    MetaUi,
+    Location,
     ModelEventMemo,
     ModelEventType,
     Region,
@@ -83,6 +88,7 @@
     @Input() onosInstMastership: string = '';
     @Input() visibleLayer: LayerType = LayerType.LAYER_DEFAULT;
     @Input() selectedLink: RegionLink = null;
+    @Input() scale: number = 1;
     @Input() regionData: Region = <Region>{devices: [ [], [], [] ], hosts: [ [], [], [] ], links: []};
     @Output() linkSelected = new EventEmitter<RegionLink>();
     @Output() selectedNodeEvent = new EventEmitter<UiElement>();
@@ -192,7 +198,7 @@
                 const loc: Location = <Location>n['location'];
                 if (loc && loc.locType === LocationType.GEO) {
                     const position: MetaUi =
-                        BackgroundSvgComponent.convertGeoToCanvas(
+                        ZoomUtils.convertGeoToCanvas(
                             <LocMeta>{lng: loc.longOrX, lat: loc.latOrY});
                     n.fx = position.x;
                     n.fy = position.y;
@@ -438,5 +444,11 @@
         });
         this.log.debug(klass, id, 'has been moved to', newLocation);
     }
+
+    resetNodeLocations() {
+        this.devices.forEach((d) => {
+            d.resetNodeLocation();
+        });
+    }
 }