From 5e45322051375def7c75226bb338bccbdeaf08cf Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 10 Jan 2023 14:36:37 +0100 Subject: [PATCH] On init - centering the map on the project without centroid feature --- .settings/org.eclipse.wst.common.component | 33 +++++++++++++------ CHANGELOG.md | 5 +-- pom.xml | 2 +- .../client/LayerManager.java | 23 ++++++++----- .../GeoportalDataViewerServiceImpl.java | 8 ++--- 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index e7cceee..a0b0c98 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -38,7 +39,8 @@ - + + @@ -77,7 +79,8 @@ - + + @@ -116,7 +119,8 @@ - + + @@ -155,7 +159,8 @@ - + + @@ -194,7 +199,8 @@ - + + @@ -233,7 +239,11 @@ - + + uses + + + @@ -272,7 +282,8 @@ - + + @@ -311,7 +322,8 @@ - + + @@ -350,7 +362,8 @@ - + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e68415..dde369e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [v3.0.1] - 2022-12-21 +## [v3.0.1-SNAPSHOT] - 2022-12-21 #### Enhancement -- [#24300] Improved the GUI of the search functionality when multiple collections are available. +- [#24300] Improved the GUI of the search functionality when multiple collections are available +- Improved the user experience providing an animated map and zoom to layers facility #### Fixes - Reduced the BBOX when resolving a project by share link diff --git a/pom.xml b/pom.xml index 29cf842..56368a5 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.gcube.portlets.user geoportal-data-viewer-app war - 3.0.1 + 3.0.1-SNAPSHOT GeoPortal Data Viewer App The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java index 59d4197..7f4112a 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java @@ -262,6 +262,12 @@ public class LayerManager { // list of // FeatureRow if (theFeatures == null || theFeatures.isEmpty()) { + // means that another version of the project has been passed without + // features + // stored into centroid layers. + // so centering the map on the centroid passed into query and stored + // into project metadata + olMap.setCenter(queryEvent.getQueryClickExtent().getCenter()); return; } } @@ -807,8 +813,9 @@ public class LayerManager { @Override public void onBrowserEvent(Event event) { if (Event.ONCLICK == event.getTypeInt()) { - applicationBus.fireEvent(new ShowDetailsEvent(lo.getType().name(), - lo.getProfileID(), newProjectID, null, true, EVENT_SOURCE.OPEN_PROJECTS)); + applicationBus.fireEvent( + new ShowDetailsEvent(lo.getType().name(), lo.getProfileID(), + newProjectID, null, true, EVENT_SOURCE.OPEN_PROJECTS)); } } @@ -989,8 +996,8 @@ public class LayerManager { buttonViewLayers.getElement().setId("go-to-layers"); buttonViewLayers.getElement().setTitle("Zoom to Layers"); buttonViewLayers.setType(ButtonType.LINK); - - if(olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) { + + if (olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) { buttonViewLayers.setVisible(false); } @@ -1104,10 +1111,10 @@ public class LayerManager { @Override public void onBrowserEvent(Event event) { if (Event.ONCLICK == event.getTypeInt()) { - //buttonElement.setAttribute("visible", "none"); - //buttonElement.getStyle().setVisibility(Visibility.HIDDEN); + // buttonElement.setAttribute("visible", "none"); + // buttonElement.getStyle().setVisibility(Visibility.HIDDEN); fireGoToLayers(); - + } } }); @@ -1129,7 +1136,7 @@ public class LayerManager { try { Element buttonElement = DOM.getElementById("go-to-layers"); buttonElement.getStyle().setVisibility(Visibility.HIDDEN); - }catch (Exception e) { + } catch (Exception e) { // TODO: handle exception } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java index 2c7a201..a920063 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java @@ -752,7 +752,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme try { SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); } catch (Exception e) { - LOG.info("User not found in session, the userName for cecking policy will be null"); + LOG.info("User not found in session, the userName for checking policy will be null"); } LOG.info("Trying to get project for id " + profileID); @@ -807,7 +807,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme try { SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); } catch (Exception e) { - LOG.info("User not found in session, the userName for cecking policy will be null"); + LOG.info("User not found in session, the userName for checking the policy will be null"); } LOG.info("Trying to get project for id " + profileID); @@ -856,7 +856,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme try { userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); } catch (Exception e) { - LOG.info("User not found in session, the userName for cecking policy will be null"); + LOG.info("User not found in session, the userName for checking the policy will be null"); } LOG.info("Trying to get project for id " + profileID); @@ -920,7 +920,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme try { userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); } catch (Exception e) { - LOG.info("User not found in session, the userName for cecking policy will be null"); + LOG.info("User not found in session, the userName for checking the policy will be null"); } LOG.info("Trying to get project for id " + profileID);