Double click on geo map zoom in and center map on point under cursor (issue #1134)
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 25 Jan 2016 08:26:21 +0000 (10:26 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 25 Jan 2016 08:29:14 +0000 (10:29 +0200)
ChangeLog
src/java/netxms-eclipse/OSM/META-INF/MANIFEST.MF
src/java/netxms-eclipse/OSM/src/org/netxms/ui/eclipse/osm/widgets/AbstractGeoMapViewer.java
webui/webapp/OSM/META-INF/MANIFEST.MF
webui/webapp/OSM/src/org/netxms/ui/eclipse/osm/widgets/AbstractGeoMapViewer.java

index d94bf84..48a604d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,12 +9,13 @@
 - Object custom attributes can be accessed as hash map in NXSL
 - Management console:
        - Improved file transfer error handling
+       - Double click on geo map zoom in and center map on point under cursor
 - Android Console:
        - Updated ACRA library: now crash reports are sent via e-mail (will use the app installed on device to send mail)
        - Fixed bug in action bar commands: disconnect and exit sometimes wasn't working
 - Android Agent:
        - Updated ACRA library: now crash reports are sent via e-mail (will use the app installed on device to send mail)
-- Fixed issues: #1042, #1049, #1117, #1125, #1133, #1139
+- Fixed issues: #1042, #1049, #1117, #1125, #1133, #1134, #1139
 
 
 *
index 9161a17..c8a95a0 100644 (file)
@@ -2,13 +2,13 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Open Street Maps Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.osm;singleton:=true
-Bundle-Version: 2.0.7
+Bundle-Version: 2.0.8
 Bundle-Activator: org.netxms.ui.eclipse.osm.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
  org.eclipse.core.runtime;bundle-version="3.8.0",
- org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.7",
- org.netxms.ui.eclipse.console;bundle-version="2.0.7",
+ org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.9",
+ org.netxms.ui.eclipse.console;bundle-version="2.0.9",
  org.netxms.ui.eclipse.objectbrowser;bundle-version="2.0.7"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 17737d5..94fcafd 100644 (file)
@@ -577,6 +577,20 @@ public abstract class AbstractGeoMapViewer extends Canvas implements PaintListen
        @Override
        public void mouseDoubleClick(MouseEvent e)
        {
+      int zoom = accessor.getZoom();
+      if (zoom < 18)
+      {
+         int step = ((e.stateMask & SWT.SHIFT) != 0) ? 4 : 1;
+         zoom = (zoom + step > 18) ? 18 : zoom + step;
+         
+         final GeoLocation geoLocation = getLocationAtPoint(new Point(e.x, e.y));
+         accessor.setZoom(zoom);
+         accessor.setLatitude(geoLocation.getLatitude());
+         accessor.setLongitude(geoLocation.getLongitude());
+         reloadMap();
+         notifyOnZoomChange();
+         notifyOnPositionChange();
+      }
        }
 
        /* (non-Javadoc)
index a6548fd..f8a8a5d 100644 (file)
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Open Street Maps Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.osm;singleton:=true
-Bundle-Version: 2.0.7
+Bundle-Version: 2.0.8
 Bundle-Activator: org.netxms.ui.eclipse.osm.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.rap.ui;bundle-version="2.3.2",
- org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.7",
- org.netxms.webui.core;bundle-version="2.0.7",
+ org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.9",
+ org.netxms.webui.core;bundle-version="2.0.9",
  org.netxms.ui.eclipse.objectbrowser;bundle-version="2.0.7",
  org.netxms.rap.draw2d.compatibility;bundle-version="1.5.2"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
index 660410a..df6e301 100644 (file)
@@ -529,6 +529,20 @@ public abstract class AbstractGeoMapViewer extends Canvas implements PaintListen
        @Override
        public void mouseDoubleClick(MouseEvent e)
        {
+      int zoom = accessor.getZoom();
+      if (zoom < 18)
+      {
+         int step = ((e.stateMask & SWT.SHIFT) != 0) ? 4 : 1;
+         zoom = (zoom + step > 18) ? 18 : zoom + step;
+         
+         final GeoLocation geoLocation = getLocationAtPoint(new Point(e.x, e.y));
+         accessor.setZoom(zoom);
+         accessor.setLatitude(geoLocation.getLatitude());
+         accessor.setLongitude(geoLocation.getLongitude());
+         reloadMap();
+         notifyOnZoomChange();
+         notifyOnPositionChange();
+      }
        }
 
        /* (non-Javadoc)