On init - centering the map on the project without centroid feature

This commit is contained in:
Francesco Mangiacrapa 2023-01-10 14:36:37 +01:00
parent cef3b61800
commit 5e45322051
5 changed files with 46 additions and 25 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -38,7 +39,8 @@
<wb-module deploy-name="geoportal-data-viewer-app-3.0.1"> <wb-module deploy-name="geoportal-data-viewer-app-3.0.1">
@ -77,7 +79,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -116,7 +119,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -155,7 +159,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -194,7 +199,8 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -233,7 +239,11 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-data-common-2.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -272,7 +282,8 @@
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/> <property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
@ -311,7 +322,8 @@
<property name="context-root" value="geoportal-data-viewer-app"/> <property name="context-root" value="geoportal-data-viewer-app"/>
@ -350,7 +362,8 @@
</wb-module> </wb-module>

View File

@ -4,10 +4,11 @@
All notable changes to this project will be documented in this file. 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). 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 #### 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 #### Fixes
- Reduced the BBOX when resolving a project by share link - Reduced the BBOX when resolving a project by share link

View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-viewer-app</artifactId> <artifactId>geoportal-data-viewer-app</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>3.0.1</version> <version>3.0.1-SNAPSHOT</version>
<name>GeoPortal Data Viewer App</name> <name>GeoPortal Data Viewer App</name>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description> <description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>

View File

@ -262,6 +262,12 @@ public class LayerManager {
// list of // list of
// FeatureRow // FeatureRow
if (theFeatures == null || theFeatures.isEmpty()) { 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; return;
} }
} }
@ -807,8 +813,9 @@ public class LayerManager {
@Override @Override
public void onBrowserEvent(Event event) { public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) { if (Event.ONCLICK == event.getTypeInt()) {
applicationBus.fireEvent(new ShowDetailsEvent(lo.getType().name(), applicationBus.fireEvent(
lo.getProfileID(), newProjectID, null, true, EVENT_SOURCE.OPEN_PROJECTS)); 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().setId("go-to-layers");
buttonViewLayers.getElement().setTitle("Zoom to Layers"); buttonViewLayers.getElement().setTitle("Zoom to Layers");
buttonViewLayers.setType(ButtonType.LINK); buttonViewLayers.setType(ButtonType.LINK);
if(olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) { if (olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) {
buttonViewLayers.setVisible(false); buttonViewLayers.setVisible(false);
} }
@ -1104,10 +1111,10 @@ public class LayerManager {
@Override @Override
public void onBrowserEvent(Event event) { public void onBrowserEvent(Event event) {
if (Event.ONCLICK == event.getTypeInt()) { if (Event.ONCLICK == event.getTypeInt()) {
//buttonElement.setAttribute("visible", "none"); // buttonElement.setAttribute("visible", "none");
//buttonElement.getStyle().setVisibility(Visibility.HIDDEN); // buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
fireGoToLayers(); fireGoToLayers();
} }
} }
}); });
@ -1129,7 +1136,7 @@ public class LayerManager {
try { try {
Element buttonElement = DOM.getElementById("go-to-layers"); Element buttonElement = DOM.getElementById("go-to-layers");
buttonElement.getStyle().setVisibility(Visibility.HIDDEN); buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
}catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
} }
} }

View File

@ -752,7 +752,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
try { try {
SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername();
} catch (Exception e) { } 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); LOG.info("Trying to get project for id " + profileID);
@ -807,7 +807,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
try { try {
SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername();
} catch (Exception e) { } 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); LOG.info("Trying to get project for id " + profileID);
@ -856,7 +856,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
try { try {
userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername();
} catch (Exception e) { } 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); LOG.info("Trying to get project for id " + profileID);
@ -920,7 +920,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
try { try {
userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername(); userName = SessionUtil.getCurrentUser(this.getThreadLocalRequest()).getUsername();
} catch (Exception e) { } 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); LOG.info("Trying to get project for id " + profileID);