More plumbing of grid coordinates vs. geo coordinates.
- Added background reference parameter to layout command
- send correct location data to client for devices, hosts

Change-Id: Ic00bda76f4e4bc8d3e23e07a08f3bc5367ec85a9
diff --git a/web/gui/src/main/webapp/app/view/topo/topoModel.js b/web/gui/src/main/webapp/app/view/topo/topoModel.js
index 0b4fd2c..887635d 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoModel.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoModel.js
@@ -115,7 +115,7 @@
         var loc = node.location,
             coord;
 
-        if (loc && loc.type === 'lnglat') {
+        if (loc && loc.type === 'geo') {
             coord = coordFromLngLat(loc);
             node.fixed = true;
             node.px = node.x = coord[0];
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2NodePosition.js b/web/gui/src/main/webapp/app/view/topo2/topo2NodePosition.js
index 6dedcd9..694af14 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2NodePosition.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2NodePosition.js
@@ -93,7 +93,7 @@
         var loc = el.get('location'),
             coord;
 
-        if (loc && loc.type === 'lnglat') {
+        if (loc && loc.type === 'geo') {
 
             if (loc.lat === 0 && loc.lng === 0) {
                 return false;
@@ -106,6 +106,9 @@
 
             return true;
         }
+
+        // TODO: handle case where loc.type === 'grid'
+        //  implying loc.gridX and loc.gridY hold values
     }
 
     function coordFromLngLat(loc) {
diff --git a/web/gui/src/main/webapp/tests/app/view/topo/topoModel-spec.js b/web/gui/src/main/webapp/tests/app/view/topo/topoModel-spec.js
index 0d1f8a5..e9f63f6 100644
--- a/web/gui/src/main/webapp/tests/app/view/topo/topoModel-spec.js
+++ b/web/gui/src/main/webapp/tests/app/view/topo/topoModel-spec.js
@@ -232,7 +232,7 @@
     it('should position a node by translating lng/lat', function () {
         var node = {
             location: {
-                type: 'lnglat',
+                type: 'geo',
                 lng: 2008,
                 lat: 3009
             }
@@ -319,7 +319,7 @@
             type: 'yowser',
             online: true,
             location: {
-                type: 'lnglat',
+                type: 'geo',
                 lng: 2048,
                 lat: 3096
             }