merged with feature 19207

This commit is contained in:
Francesco Mangiacrapa 2020-05-08 10:19:15 +02:00
parent 11fc63e16a
commit be6c932e21
5 changed files with 57 additions and 45 deletions

View File

@ -4,7 +4,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="gis-viewer-4.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gis-viewer/gis-viewer">
<dependent-module archiveName="gis-viewer-4.5.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gis-viewer/gis-viewer">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -1,11 +1,18 @@
<ReleaseNotes>
<Changeset
component="org.gcube.portlets.user.gisvieweapp.1-8-0"
date="2020-05-05">
<Change>[Task #19207]: init parameter to set max zoom level
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets.user.gisvieweapp.1-7-0"
date="2020-04-24">
<Change>[Feature #19109] integrated with new Gis-Viewer capabilities
</Change>
<Change>[Feature #19111] GisViewer 'zoom' and 'center' to Map readable
as HTTP GET parameters</Change>
as HTTP GET parameters
</Change>
<Change>[Feature #19172] Gis-Viewer-App: update the look and feel of
Gis-Viewer
</Change>

View File

@ -13,10 +13,10 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gis-viewer-app</artifactId>
<packaging>war</packaging>
<version>1.7.0</version>
<version>1.8.0-SNAPSHOT</version>
<name>Gis Viewer App</name>
<description>
The Gis Viewer App is a web application to interact with Gis Viwewer Widget
The Gis Viewer App is a web application to interact with Gis Viewer Widget
</description>
<scm>

View File

@ -10,8 +10,8 @@ import org.gcube.portlets.user.gisviewer.client.DataPanelOpenListener;
import org.gcube.portlets.user.gisviewer.client.GisViewerMapLoadedNotification.GisViewerMapLoadedtListener;
import org.gcube.portlets.user.gisviewer.client.GisViewerPanel;
import org.gcube.portlets.user.gisviewer.client.GisViewerParameters;
import org.gcube.portlets.user.gisviewer.client.OpenLayersMapParameters;
import org.gcube.portlets.user.gisviewerapp.client.resources.Images;
import org.gwtopenmaps.openlayers.client.LonLat;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
@ -60,8 +60,12 @@ public class ApplicationController {
private static final String GCUBE_COOKIE_SHOW_WARNING_FOR_WPS_DATA_POINT_QUERY= "GCUBE-Cookie_GeoWPSQuery_DataPoint_Authorization";
private static final String GCUBE_COOKIE_SHOW_WARNING_FOR_WPS_BOX_QUERY = "GCUBE-Cookie_GeoWPSQuery_Box_Authorization";
public static final long MILLISECS_PER_DAY = 1000L * 60L * 60L * 24L;
private String longLatGetParameter;
private String zoomGetParameter;
private String paramLongLat;
private String paramZoom;
private String paramMaxZoomLevel;
private String paramWmsRequest;
private String paramUUID;
private String paramLayerTitle;
/**
* Instantiates a new application controller.
@ -86,7 +90,28 @@ public class ApplicationController {
gisViewerParameters = new GisViewerParameters();
gisViewerParameters.setProjection("");
gisViewerParameters.setOpenDataPanelAtStart(false);
//READING QUERY STRING PARAMETER TO INIT OL MAP
paramMaxZoomLevel = Window.Location.getParameter(ConstantGisViewerApp.GET_MAX_ZOOM_LEVEL);
paramZoom = Window.Location.getParameter(ConstantGisViewerApp.GET_ZOOM);
paramLongLat = Window.Location.getParameter(ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT);
GWT.log(ConstantGisViewerApp.GET_ZOOM+ " = "+paramZoom);
GWT.log(ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT+ " = "+paramLongLat);
GWT.log(ConstantGisViewerApp.GET_MAX_ZOOM_LEVEL+ " = "+paramMaxZoomLevel);
OpenLayersMapParameters oLMP = new OpenLayersMapParameters();
if(paramZoom!=null)
oLMP.addParameter(ConstantGisViewerApp.GET_ZOOM, paramZoom);
if(paramMaxZoomLevel!=null)
oLMP.addParameter(ConstantGisViewerApp.GET_MAX_ZOOM_LEVEL, paramMaxZoomLevel);
if(paramLongLat!=null)
oLMP.addParameter(ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT, paramLongLat);
gisViewerParameters.setOpenLayersMapParameters(oLMP);
gisViewerParameters.setDataPanelOpenListener(new DataPanelOpenListener() {
@Override
public void dataPanelOpen(boolean isOpen, int panelHeight) {
@ -143,26 +168,22 @@ public class ApplicationController {
public void go(final RootPanel rootPanel) {
this.gwtRootPanel = rootPanel;
rootPanel.add(mainPanel);
String wmsRequest = Window.Location.getParameter(ConstantGisViewerApp.GET_WMS_PARAMETER);
String uuid = Window.Location.getParameter(ConstantGisViewerApp.GET_UUID_PARAMETER);
String layerTitle = Window.Location.getParameter(ConstantGisViewerApp.GET_LAYER_TITLE);
longLatGetParameter = Window.Location.getParameter(ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT);
zoomGetParameter = Window.Location.getParameter(ConstantGisViewerApp.GET_ZOOM);
GWT.log(ConstantGisViewerApp.GET_WMS_PARAMETER+ " = "+wmsRequest);
GWT.log(ConstantGisViewerApp.GET_UUID_PARAMETER+ " = "+uuid);
GWT.log(ConstantGisViewerApp.GET_LAYER_TITLE+ " = "+layerTitle);
GWT.log(ConstantGisViewerApp.GET_ZOOM+ " = "+zoomGetParameter);
GWT.log(ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT+ " = "+longLatGetParameter);
paramWmsRequest = Window.Location.getParameter(ConstantGisViewerApp.GET_WMS_PARAMETER);
paramUUID = Window.Location.getParameter(ConstantGisViewerApp.GET_UUID_PARAMETER);
paramLayerTitle = Window.Location.getParameter(ConstantGisViewerApp.GET_LAYER_TITLE);
GWT.log(ConstantGisViewerApp.GET_WMS_PARAMETER+ " = "+paramWmsRequest);
GWT.log(ConstantGisViewerApp.GET_UUID_PARAMETER+ " = "+paramUUID);
GWT.log(ConstantGisViewerApp.GET_LAYER_TITLE+ " = "+paramLayerTitle);
addGisViewerHandlers();
if(wmsRequest!=null && !wmsRequest.isEmpty()){
if(paramWmsRequest!=null && !paramWmsRequest.isEmpty()){
try {
wmsRequestConverter.addRequestToGisViewer(wmsRequest,layerTitle, uuid);
wmsRequestConverter.addRequestToGisViewer(paramWmsRequest,paramLayerTitle, paramUUID);
} catch (Exception e) {
GWT.log("An error occurred on adding wmsrequest :"+wmsRequest);
GWT.log("An error occurred on adding wmsrequest :"+paramWmsRequest);
e.printStackTrace();
}
}
@ -241,7 +262,7 @@ public class ApplicationController {
}
displayWarning = readCookieWPSQueryAuthorization(GCUBE_COOKIE_SHOW_WARNING_FOR_WPS_BOX_QUERY);
GWT.log("Display " + GCUBE_COOKIE_SHOW_WARNING_FOR_WPS_BOX_QUERY + "? " + displayWarning);
GWT.log("DisplsetCenterMapToay " + GCUBE_COOKIE_SHOW_WARNING_FOR_WPS_BOX_QUERY + "? " + displayWarning);
if (displayWarning) {
gisViewerPanel.getToolBarPanel().getBoxDataToggle()
@ -263,25 +284,6 @@ public class ApplicationController {
}
});
}
try {
if(zoomGetParameter!=null) {
int zoomLevel = Integer.parseInt(zoomGetParameter);
gisViewerPanel.getOpenLayersMap().setZoomLevel(zoomLevel);
}
}catch (Exception e) {
GWT.log("BAD value: "+zoomGetParameter+" for parameter: "+ConstantGisViewerApp.GET_ZOOM);
}
try {
if(longLatGetParameter!=null) {
String[] theLongLat = longLatGetParameter.split(",");
LonLat lonlat = new LonLat(Double.parseDouble(theLongLat[0]), Double.parseDouble(theLongLat[1]));
gisViewerPanel.getOpenLayersMap().setCenterAt(lonlat);
}
}catch (Exception e) {
GWT.log("BAD value: "+longLatGetParameter+" for parameter: "+ConstantGisViewerApp.GET_CENTER_MAP_TO_LONG_LAT);
}
}
@Override

View File

@ -3,7 +3,7 @@
*/
package org.gcube.portlets.user.gisviewerapp.client;
import org.gcube.portlets.user.gisviewer.client.OpenLayersMapParameters;
/**
* The Class ConstantGisViewerApp.
@ -18,7 +18,10 @@ public class ConstantGisViewerApp {
public static final String GET_UUID_PARAMETER = "uuid";
public static final String WMS_PARAM_SEPARATOR_REPLACEMENT_KEY = "separtor";
public static final String GET_LAYER_TITLE = "layertitle";
public static final String GET_ZOOM = "zoom";
public static final String GET_CENTER_MAP_TO_LONG_LAT = "centermap";
public static final String GET_MAX_ZOOM_LEVEL = OpenLayersMapParameters.OL_MAP_PARAM.maxzoomlevel.name();
public static final String GET_ZOOM = OpenLayersMapParameters.OL_MAP_PARAM.zoom.name();
public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name();
}