Added CLI command ui-geo-map-list.

Change-Id: I867db6fe82fb94f1083beaf3e661aa0d692b1865
diff --git a/core/api/src/main/java/org/onosproject/ui/UiTopoMap.java b/core/api/src/main/java/org/onosproject/ui/UiTopoMap.java
index ec4e239..73f7988 100644
--- a/core/api/src/main/java/org/onosproject/ui/UiTopoMap.java
+++ b/core/api/src/main/java/org/onosproject/ui/UiTopoMap.java
@@ -16,6 +16,7 @@
 
 package org.onosproject.ui;
 
+import static com.google.common.base.MoreObjects.toStringHelper;
 import static com.google.common.base.Preconditions.checkState;
 
 /**
@@ -35,10 +36,10 @@
     /**
      * Creates a new topology map.
      *
-     * @param id map identifier
-     * @param desc map description
+     * @param id       map identifier
+     * @param desc     map description
      * @param filePath map filePath
-     * @param scale map scale
+     * @param scale    map scale
      */
     public UiTopoMap(String id, String desc, String filePath, double scale) {
         checkState(desc.length() <= MAX_LENGTH, DES_EXC_LIM);
@@ -83,4 +84,12 @@
     public double scale() {
         return scale;
     }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("id", id)
+                .add("desc", desc)
+                .toString();
+    }
 }
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/cli/UiGeoMapListCommand.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/cli/UiGeoMapListCommand.java
new file mode 100644
index 0000000..1a957ac
--- /dev/null
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/cli/UiGeoMapListCommand.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.onosproject.ui.impl.topo.cli;
+
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.ui.UiExtensionService;
+import org.onosproject.ui.UiTopoMapFactory;
+
+/**
+ * CLI command to list the registered geographic maps, that may be used
+ * by the topology view.
+ */
+@Command(scope = "onos", name = "ui-geo-map-list",
+        description = "Lists available geographic maps for topology view")
+public class UiGeoMapListCommand extends AbstractShellCommand {
+
+    @Override
+    protected void execute() {
+        UiExtensionService uxs = get(UiExtensionService.class);
+        uxs.getExtensions().forEach(ext -> {
+            UiTopoMapFactory mapFactory = ext.topoMapFactory();
+            if (mapFactory != null) {
+                mapFactory.geoMaps().forEach(m -> print("%s", m));
+            }
+        });
+    }
+}
diff --git a/web/gui/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/web/gui/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index bd4a2ca..51f11ab 100644
--- a/web/gui/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/web/gui/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -32,6 +32,9 @@
         <command>
             <action class="org.onosproject.ui.impl.topo.cli.UiCacheLinksCommand"/>
         </command>
+        <command>
+            <action class="org.onosproject.ui.impl.topo.cli.UiGeoMapListCommand"/>
+        </command>
     </command-bundle>
 
     <!--<bean id="macIDCompleter" class="org.onosproject.dhcp.cli.MacIdCompleter"/>-->