Compare commits
7 Commits
master
...
locate_lay
Author | SHA1 | Date |
---|---|---|
Francesco Mangiacrapa | 58de632deb | |
Francesco Mangiacrapa | 619c67c5ec | |
Francesco Mangiacrapa | aaed3cf9f4 | |
Francesco Mangiacrapa | 67c037e498 | |
Francesco Mangiacrapa | 67e4275b55 | |
Francesco Mangiacrapa | 7247c3d4b6 | |
Francesco Mangiacrapa | 2b28f53652 |
|
@ -275,9 +275,6 @@
|
|||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
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.2.0-SNAPSHOT] - 2023-01-31
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#24506] Added Locate/Highlight the Layer facility on the Map
|
||||
|
||||
## [v3.1.0] - 2023-01-12
|
||||
|
||||
#### Enhancements
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -14,13 +14,13 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>geoportal-data-viewer-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>3.1.0</version>
|
||||
<version>3.2.0-SNAPSHOT</version>
|
||||
<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>
|
||||
|
||||
<properties>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwt.version>2.9.0</gwt.version>
|
||||
<gwt.version>2.10.0</gwt.version>
|
||||
<gwt.compiler.style>PRETTY</gwt.compiler.style>
|
||||
<gson.version>2.6.2</gson.version>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
|
|
|
@ -2,13 +2,16 @@ package org.gcube.portlets.user.geoportaldataviewer.client;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
|
||||
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
||||
|
@ -59,6 +62,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Popover;
|
||||
import com.github.gwtbootstrap.client.ui.constants.Placement;
|
||||
|
@ -80,6 +84,13 @@ import com.google.gwt.user.client.ui.RootPanel;
|
|||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
import ol.Coordinate;
|
||||
import ol.Feature;
|
||||
import ol.OLFactory;
|
||||
import ol.format.GeoJson;
|
||||
import ol.format.GeoJsonFeatureOptions;
|
||||
import ol.format.GeoJsonOptions;
|
||||
import ol.proj.Projection;
|
||||
import ol.proj.ProjectionOptions;
|
||||
|
||||
/**
|
||||
* Entry point classes define <code>onModuleLoad()</code>.
|
||||
|
@ -140,6 +151,9 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
private boolean initApplication;
|
||||
|
||||
// A cache (Layer_ID, GeoJSON) of layer features loaded via GetFeature Request
|
||||
private HashMap<String, String> layerFeaturesCache = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* This is the entry point method.
|
||||
*/
|
||||
|
@ -185,6 +199,9 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Inits the application.
|
||||
*/
|
||||
private void initApplication() {
|
||||
|
||||
initApplication = true;
|
||||
|
@ -285,10 +302,20 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
RootPanel.get(APP_DIV).add(attributionDiv);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status.
|
||||
*
|
||||
* @return the status
|
||||
*/
|
||||
public static ViewerStatus getStatus() {
|
||||
return viewerStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list base map layers.
|
||||
*
|
||||
* @return the list base map layers
|
||||
*/
|
||||
public static List<BaseMapLayer> getListBaseMapLayers() {
|
||||
return listBaseMapLayers;
|
||||
}
|
||||
|
@ -305,6 +332,11 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client height.
|
||||
*
|
||||
* @return the client height
|
||||
*/
|
||||
public int getClientHeight() {
|
||||
RootPanel principalDiv = RootPanel.get(APP_DIV);
|
||||
int topBorder = principalDiv.getAbsoluteTop();
|
||||
|
@ -542,7 +574,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
applicationBus.addHandler(DoActionOnDetailLayersEvent.TYPE, new DoActionOnDetailLayersEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onDoActionOnDetailLayers(DoActionOnDetailLayersEvent doLayerActionEvent) {
|
||||
public void onDoActionOnDetailLayers(final DoActionOnDetailLayersEvent doLayerActionEvent) {
|
||||
|
||||
DO_LAYER_ACTION doAction = doLayerActionEvent.getDoAction();
|
||||
GWT.log("event: " + doAction);
|
||||
|
@ -569,6 +601,56 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
doLayerActionEvent.getVisibility());
|
||||
|
||||
break;
|
||||
case LOCATE_LAYER:
|
||||
|
||||
final LayerItem layerItem = doLayerActionEvent.getLayerItem();
|
||||
|
||||
boolean layerHighlighted = olMap.areLayerFeaturesAsHighlight(layerItem);
|
||||
|
||||
if (layerHighlighted) {
|
||||
doLayerActionEvent.getSourceEventUI().setVisibleLoaderFeatures(false, null);
|
||||
olMap.removeLayerFeaturesAsHighlight(layerItem.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
final String geoJSONFeatures = layerFeaturesCache.get(layerItem.getName());
|
||||
|
||||
if (geoJSONFeatures == null) {
|
||||
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getWFSResponse(layerItem,
|
||||
olMap.getProjectionCode(), null, 0, "json", new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
doLayerActionEvent.getSourceEventUI().setVisibleLoaderFeatures(false, null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String geoJSONFeaturesResp) {
|
||||
doLayerActionEvent.getSourceEventUI().setVisibleLoaderFeatures(false, null);
|
||||
|
||||
if (geoJSONFeaturesResp != null && !geoJSONFeaturesResp.isEmpty()) {
|
||||
layerFeaturesCache.put(layerItem.getName(), geoJSONFeaturesResp);
|
||||
|
||||
GWT.log("GeoJSON: " + geoJSONFeaturesResp);
|
||||
|
||||
showLayerFeatures(layerItem, geoJSONFeaturesResp,
|
||||
doLayerActionEvent.getLayerObject().getProjectDV());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
doLayerActionEvent.getSourceEventUI().setVisibleLoaderFeatures(false, null);
|
||||
showLayerFeatures(layerItem, geoJSONFeatures,
|
||||
doLayerActionEvent.getLayerObject().getProjectDV());
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -686,6 +768,17 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the.
|
||||
*
|
||||
* @param json the json
|
||||
* @return the object
|
||||
*/
|
||||
public static native Object toJSON(String json) /*-{
|
||||
var jsonObj = JSON.parse(json);
|
||||
//console.log("jsonObj: "+jsonObj);
|
||||
return jsonObj;
|
||||
}-*/;
|
||||
// /**
|
||||
// * Handler popu closer.
|
||||
// *
|
||||
|
@ -703,6 +796,13 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
//
|
||||
// }-*/;
|
||||
|
||||
/**
|
||||
* Perform WFS query on centroid.
|
||||
*
|
||||
* @param projectID the project ID
|
||||
* @param centroidLong the centroid long
|
||||
* @param centroidLat the centroid lat
|
||||
*/
|
||||
private void performWFSQueryOnCentroid(String projectID, Double centroidLong, Double centroidLat) {
|
||||
GWT.log("Perform performWFSQueryOnCentroid: " + projectID + " long: " + centroidLong + ", lat: " + centroidLat);
|
||||
if (projectID != null) {
|
||||
|
@ -727,6 +827,13 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show popover.
|
||||
*
|
||||
* @param w the w
|
||||
* @param message the message
|
||||
* @param heading the heading
|
||||
*/
|
||||
public static void showPopover(final Widget w, String message, String heading) {
|
||||
|
||||
final Popover popover = new Popover();
|
||||
|
@ -748,6 +855,11 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
timer.schedule(3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the general error panel.
|
||||
*
|
||||
* @return the general error panel
|
||||
*/
|
||||
private FlowPanel getGeneralErrorPanel() {
|
||||
Image geoportalError = new Image(GNAImages.ICONS.geoportaServiceError());
|
||||
FlowPanel errorPanelMsg = new FlowPanel();
|
||||
|
@ -760,4 +872,41 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
return errorPanelMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show layer features.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param geoJSONFeatures the geo JSON features
|
||||
* @param projectDV the project DV
|
||||
*/
|
||||
private void showLayerFeatures(LayerItem layerItem, String geoJSONFeatures, ProjectDV projectDV) {
|
||||
|
||||
GeoJsonFeatureOptions fo = new GeoJsonFeatureOptions();
|
||||
ProjectionOptions projectionOptions = new ProjectionOptions();
|
||||
projectionOptions.setCode(MAP_PROJECTION.EPSG_4326.getName());
|
||||
Projection fp = new Projection(projectionOptions);
|
||||
fo.setFeatureProjection(fp);
|
||||
fo.setDataProjection(fp);
|
||||
GeoJsonOptions geoJsonOpt = new GeoJsonOptions();
|
||||
geoJsonOpt.setDefaultDataProjection(fp);
|
||||
geoJsonOpt.setFeatureProjection(fp);
|
||||
GeoJson geoJson = OLFactory.createGeoJSON(geoJsonOpt);
|
||||
|
||||
Feature[] features = geoJson.readFeatures(geoJSONFeatures);
|
||||
|
||||
GWT.log("features: " + features);
|
||||
olMapMng.getOLMap().addLayerFeaturesAsHighlight(layerItem, features);
|
||||
|
||||
if (projectDV != null) {
|
||||
GeoJSON spatialReference = projectDV.getSpatialReference();
|
||||
|
||||
GWT.log("spatialReference is: " + spatialReference);
|
||||
Coordinate transfCoord = MapUtils.geoJSONTToBBoxCenter(spatialReference, MAP_PROJECTION.EPSG_4326.getName(),
|
||||
MAP_PROJECTION.EPSG_3857.getName());
|
||||
GWT.log("transfCoord is: " + transfCoord);
|
||||
if (transfCoord != null)
|
||||
olMapMng.getOLMap().setCenter(transfCoord);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class GeoportalDataViewerConstants {
|
|||
* @param msg the msg
|
||||
*/
|
||||
public static native void printJs(String msg)/*-{
|
||||
console.log("js console: " + msg);
|
||||
//console.log("js console: " + msg);
|
||||
}-*/;
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ public class GeoportalDataViewerConstants {
|
|||
* @param msg the msg
|
||||
*/
|
||||
public static native void printJsObj(Object object)/*-{
|
||||
console.log("js obj: " + JSON.stringify(object, null, 4));
|
||||
//console.log("js obj: " + JSON.stringify(object, null, 4));
|
||||
}-*/;
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
|
||||
|
@ -179,4 +180,30 @@ public interface GeoportalDataViewerService extends RemoteService {
|
|||
*/
|
||||
GeoJSON getSpatialReference(String profileID, String projectID);
|
||||
|
||||
/**
|
||||
* Gets the WFS request.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features. If 0 means all feature
|
||||
* @param outputFormat the output format
|
||||
* @return the WFS request
|
||||
*/
|
||||
String getWFSRequest(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
|
||||
String outputFormat);
|
||||
|
||||
/**
|
||||
* Gets the WFS response.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features
|
||||
* @param outputFormat the output format
|
||||
* @return the WFS response
|
||||
*/
|
||||
String getWFSResponse(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
|
||||
String outputFormat);
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
||||
|
||||
|
@ -75,4 +76,10 @@ public interface GeoportalDataViewerServiceAsync {
|
|||
|
||||
void getSpatialReference(String profileID, String projectID, AsyncCallback<GeoJSON> callback);
|
||||
|
||||
void getWFSRequest(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures, String outputFormat,
|
||||
AsyncCallback<String> callback);
|
||||
|
||||
void getWFSResponse(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures, String outputFormat,
|
||||
AsyncCallback<String> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -412,6 +412,7 @@ public class LayerManager {
|
|||
public void removeAllDetailLayers() {
|
||||
mapOtherLayerObjects.clear();
|
||||
olMap.removeAllDetailLayers();
|
||||
olMap.removeAllLayerFeaturesAsHighlight();
|
||||
overlayLayerManager.resetLayers();
|
||||
}
|
||||
|
||||
|
@ -1344,7 +1345,7 @@ public class LayerManager {
|
|||
* Fire go to layers.
|
||||
*/
|
||||
protected void fireGoToLayers() {
|
||||
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 1);
|
||||
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 0.1);
|
||||
olMap.setZoom(zoomValue);
|
||||
try {
|
||||
Element buttonElement = DOM.getElementById("go-to-layers");
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd.DragDropLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
@ -22,7 +24,7 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
* Oct 12, 2021
|
||||
*/
|
||||
public static enum DO_LAYER_ACTION {
|
||||
VISIBILITY, SWAP, OPACITY
|
||||
VISIBILITY, SWAP, OPACITY, LOCATE_LAYER
|
||||
}
|
||||
|
||||
private DO_LAYER_ACTION doAction;
|
||||
|
@ -31,29 +33,31 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
private boolean visibility;
|
||||
private SwapLayer sourceLayerSwap;
|
||||
private SwapLayer targetLayerSwap;
|
||||
|
||||
private LayerObject layerObject;
|
||||
private DragDropLayer sourceEventUI;
|
||||
|
||||
/**
|
||||
* The Class SwapLayer.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Oct 15, 2021
|
||||
* Oct 15, 2021
|
||||
*/
|
||||
public static class SwapLayer{
|
||||
public static class SwapLayer {
|
||||
private LayerItem layerItem;
|
||||
private int position;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new swap layer.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param position the position
|
||||
* @param position the position
|
||||
*/
|
||||
public SwapLayer(LayerItem layerItem, int position){
|
||||
public SwapLayer(LayerItem layerItem, int position) {
|
||||
this.layerItem = layerItem;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the layer item.
|
||||
*
|
||||
|
@ -62,7 +66,7 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
public LayerItem getLayerItem() {
|
||||
return layerItem;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the position.
|
||||
*
|
||||
|
@ -76,11 +80,13 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
/**
|
||||
* Instantiates a new do action on detail layers event.
|
||||
*
|
||||
* @param action the action
|
||||
* @param layerItem the layer item
|
||||
* @param action the action
|
||||
* @param layerItem the layer item
|
||||
* @param layerObject the layer object
|
||||
*/
|
||||
public DoActionOnDetailLayersEvent(DO_LAYER_ACTION action, LayerItem layerItem) {
|
||||
public DoActionOnDetailLayersEvent(DO_LAYER_ACTION action, LayerItem layerItem, LayerObject layerObject) {
|
||||
this.layerItem = layerItem;
|
||||
this.layerObject = layerObject;
|
||||
this.doAction = action;
|
||||
}
|
||||
|
||||
|
@ -135,6 +141,24 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the layer object.
|
||||
*
|
||||
* @return the layer object
|
||||
*/
|
||||
public LayerObject getLayerObject() {
|
||||
return layerObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the layer object.
|
||||
*
|
||||
* @param layerObject the new layer object
|
||||
*/
|
||||
public void setLayerObject(LayerObject layerObject) {
|
||||
this.layerObject = layerObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the do action.
|
||||
*
|
||||
|
@ -189,6 +213,25 @@ public class DoActionOnDetailLayersEvent extends GwtEvent<DoActionOnDetailLayers
|
|||
return visibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the UI event source.
|
||||
*
|
||||
* @param sourceEventUI the new UI event source
|
||||
*/
|
||||
public void setUIEventSource(DragDropLayer sourceEventUI) {
|
||||
this.sourceEventUI = sourceEventUI;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source event UI.
|
||||
*
|
||||
* @return the source event UI
|
||||
*/
|
||||
public DragDropLayer getSourceEventUI() {
|
||||
return sourceEventUI;
|
||||
}
|
||||
|
||||
/**
|
||||
* To string.
|
||||
*
|
||||
|
|
|
@ -37,6 +37,7 @@ import ol.Size;
|
|||
import ol.View;
|
||||
import ol.ViewOptions;
|
||||
import ol.animation.AnimationOptions;
|
||||
import ol.color.Color;
|
||||
import ol.event.EventListener;
|
||||
import ol.geom.Geometry;
|
||||
import ol.interaction.Draw;
|
||||
|
@ -62,6 +63,11 @@ import ol.source.Source;
|
|||
import ol.source.Vector;
|
||||
import ol.source.Xyz;
|
||||
import ol.source.XyzOptions;
|
||||
import ol.style.Fill;
|
||||
import ol.style.FillOptions;
|
||||
import ol.style.Stroke;
|
||||
import ol.style.StrokeOptions;
|
||||
import ol.style.Style;
|
||||
|
||||
/**
|
||||
* The Class OpenLayerMap.
|
||||
|
@ -72,6 +78,8 @@ import ol.source.XyzOptions;
|
|||
*/
|
||||
public abstract class OpenLayerMap {
|
||||
|
||||
private static final int MAX_LENGHT_CQL_FOR_GET_REQUEST = 1600; // 1600 characters
|
||||
|
||||
public static final int SET_CENTER_ANIMATED_DURATION = 500;
|
||||
|
||||
public static final int ZOOM_ANIMATED_DURATION = 3000;
|
||||
|
@ -143,6 +151,8 @@ public abstract class OpenLayerMap {
|
|||
|
||||
private LinkedHashMap<String, Image> wmsLayerMap;
|
||||
|
||||
private LinkedHashMap<String, ol.layer.Vector> vectorLayersHighlighted = new LinkedHashMap<String, ol.layer.Vector>();
|
||||
|
||||
private Layer baseLayerTile;
|
||||
|
||||
private LayerOrder layerOrder = new LayerOrder();
|
||||
|
@ -302,13 +312,13 @@ public abstract class OpenLayerMap {
|
|||
* @param centerCoordinate the new center
|
||||
*/
|
||||
public void setCenter(Coordinate centerCoordinate) {
|
||||
|
||||
|
||||
AnimationOptions animations = new AnimationOptions();
|
||||
animations.setCenter(centerCoordinate);
|
||||
animations.setDuration(SET_CENTER_ANIMATED_DURATION);
|
||||
view.animate(animations);
|
||||
|
||||
//view.setCenter(centerCoordinate);
|
||||
|
||||
// view.setCenter(centerCoordinate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -321,7 +331,7 @@ public abstract class OpenLayerMap {
|
|||
animations.setDuration(ZOOM_ANIMATED_DURATION);
|
||||
animations.setZoom(zoom);
|
||||
view.animate(animations);
|
||||
//view.setZoom(zoom);
|
||||
// view.setZoom(zoom);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -445,6 +455,12 @@ public abstract class OpenLayerMap {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the CQL filter to WMS layer.
|
||||
*
|
||||
* @param key the key
|
||||
* @param cqlFilterExpression the cql filter expression
|
||||
*/
|
||||
public void setCQLFilterToWMSLayer(String key, String cqlFilterExpression) {
|
||||
|
||||
GWT.log("Getting key: " + key);
|
||||
|
@ -459,7 +475,7 @@ public abstract class OpenLayerMap {
|
|||
ImageWms imageWMSSource = wmsLayer.getSource();
|
||||
ImageWmsParams imageWMSParams = imageWMSSource.getParams();
|
||||
|
||||
if (cqlFilterExpression == null) {
|
||||
if (cqlFilterExpression == null || cqlFilterExpression.length() > MAX_LENGHT_CQL_FOR_GET_REQUEST) {
|
||||
imageWMSParams.delete("CQL_FILTER");
|
||||
} else {
|
||||
imageWMSParams.set("CQL_FILTER", cqlFilterExpression);
|
||||
|
@ -468,6 +484,8 @@ public abstract class OpenLayerMap {
|
|||
imageWMSSource.updateParams(imageWMSParams);
|
||||
wmsLayer.setSource(imageWMSSource);
|
||||
|
||||
wmsLayer.changed();
|
||||
|
||||
// map.addLayer(wmsLayer);
|
||||
|
||||
}
|
||||
|
@ -524,10 +542,12 @@ public abstract class OpenLayerMap {
|
|||
|
||||
/**
|
||||
* Removes the all detail layers.
|
||||
*
|
||||
* @param layerName the layer name
|
||||
*/
|
||||
public void removeWMSLayer(String layerName) {
|
||||
GWT.log("Removing layerName: " + layerName + " from map: " + wmsLayerMap);
|
||||
|
||||
|
||||
// NOT NEEDED ANYMORE.. I'M USING MIN/MAX LAYER RESOLUTION
|
||||
|
||||
if (wmsLayerMap == null)
|
||||
|
@ -548,8 +568,6 @@ public abstract class OpenLayerMap {
|
|||
*/
|
||||
public void removeAllDetailLayers() {
|
||||
|
||||
// NOT NEEDED ANYMORE.. I'M USING MIN/MAX LAYER RESOLUTION
|
||||
|
||||
if (wmsDetailsLayerMap == null)
|
||||
return;
|
||||
|
||||
|
@ -564,6 +582,24 @@ public abstract class OpenLayerMap {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the all layer features as highlight.
|
||||
*/
|
||||
public void removeAllLayerFeaturesAsHighlight() {
|
||||
|
||||
if (vectorLayersHighlighted == null)
|
||||
return;
|
||||
|
||||
GWT.log("Removing vectorLayersHighlighted: " + vectorLayersHighlighted.keySet() + " from map");
|
||||
|
||||
for (String layerName : vectorLayersHighlighted.keySet()) {
|
||||
removeLayerFeaturesAsHighlight(layerName);
|
||||
}
|
||||
|
||||
vectorLayersHighlighted.clear();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the vector.
|
||||
*
|
||||
|
@ -574,12 +610,12 @@ public abstract class OpenLayerMap {
|
|||
VectorLayerOptions vectorLayerOptions = new VectorLayerOptions();
|
||||
vectorLayerOptions.setMap(map);
|
||||
|
||||
// Style style = new Style();
|
||||
// FillOptions fillOptions = new FillOptions();
|
||||
// Color color = new Color(0, 0, 255, 1.0);
|
||||
// fillOptions.setColor(color);
|
||||
// Fill fill = new Fill(fillOptions);
|
||||
// style.setFill(fill);
|
||||
Style style = new Style();
|
||||
FillOptions fillOptions = new FillOptions();
|
||||
Color color = new Color(0, 0, 255, 1.0);
|
||||
fillOptions.setColor(color);
|
||||
Fill fill = new Fill(fillOptions);
|
||||
style.setFill(fill);
|
||||
|
||||
FeatureOptions featureOptions = new FeatureOptions();
|
||||
featureOptions.setGeometry(geometry);
|
||||
|
@ -591,12 +627,87 @@ public abstract class OpenLayerMap {
|
|||
|
||||
ol.layer.Vector vector = OLFactory.createVector(vectorLayerOptions);
|
||||
|
||||
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.VECTOR) + 1;
|
||||
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.VECTOR) + 1000;
|
||||
vector.setZIndex(zIndex);
|
||||
|
||||
map.addLayer(vector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the vector.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param features the features
|
||||
*/
|
||||
public void addLayerFeaturesAsHighlight(LayerItem layerItem, Feature[] features) {
|
||||
|
||||
removeLayerFeaturesAsHighlight(layerItem.getName());
|
||||
|
||||
Style style = new Style();
|
||||
StrokeOptions strokeOptions = new StrokeOptions();
|
||||
strokeOptions.setColor(new Color(255, 255, 0, 0.8));
|
||||
strokeOptions.setWidth(5);
|
||||
Stroke stroke = new Stroke(strokeOptions);
|
||||
stroke.setWidth(2);
|
||||
style.setStroke(stroke);
|
||||
|
||||
Vector vectorSource = OLFactory.createVectorSource();
|
||||
vectorSource.addFeatures(features);
|
||||
|
||||
GWT.log("features: " + features);
|
||||
|
||||
VectorLayerOptions vectorLayerOptions = new VectorLayerOptions();
|
||||
vectorLayerOptions.setSource(vectorSource);
|
||||
vectorLayerOptions.setStyle(style);
|
||||
|
||||
// vectorLayerOptions.setMap(map);
|
||||
|
||||
GWT.log("vectorLayerOptions: " + vectorLayerOptions);
|
||||
|
||||
ol.layer.Vector vector = OLFactory.createVector(vectorLayerOptions);
|
||||
// vector.setStyle(style);
|
||||
vector.setVisible(true);
|
||||
vector.setZIndex(5000);
|
||||
|
||||
vectorLayersHighlighted.put(layerItem.getName(), vector);
|
||||
|
||||
map.addLayer(vector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Are layer features A as highlight.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @return true, if successful
|
||||
*/
|
||||
public boolean areLayerFeaturesAsHighlight(LayerItem layerItem) {
|
||||
return vectorLayersHighlighted.get(layerItem.getName()) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the layer features A as highlight.
|
||||
*
|
||||
* @param layerName the layer name
|
||||
* @return true, if successful
|
||||
*/
|
||||
public boolean removeLayerFeaturesAsHighlight(String layerName) {
|
||||
|
||||
try {
|
||||
|
||||
ol.layer.Vector vl = vectorLayersHighlighted.get(layerName);
|
||||
|
||||
if (vl != null) {
|
||||
map.removeLayer(vl);
|
||||
vectorLayersHighlighted.remove(layerName);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the point vector source.
|
||||
*
|
||||
|
@ -967,6 +1078,4 @@ public abstract class OpenLayerMap {
|
|||
return map.get((map.keySet().toArray())[index]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,12 @@ public interface GNAImages extends ClientBundle {
|
|||
@Source("layer_invisible.png")
|
||||
ImageResource layerInvisible();
|
||||
|
||||
@Source("locate.png")
|
||||
ImageResource locate();
|
||||
|
||||
@Source("locate_none.png")
|
||||
ImageResource locateNone();
|
||||
|
||||
@Source("spinner_earth.gif")
|
||||
ImageResource spinnerEarth();
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -49,7 +49,7 @@ public class ImagesSectionGallery {
|
|||
*/
|
||||
private native void showGallery(JavaScriptObject json_array_images, String galleryDivId) /*-{
|
||||
|
||||
console.log("showing: " + json_array_images)
|
||||
//console.log("showing: " + json_array_images)
|
||||
var waitForJQuery = setInterval(
|
||||
function() {
|
||||
if (typeof $wnd.$ != 'undefined') {
|
||||
|
|
|
@ -101,6 +101,8 @@ public class LayersSectionViewer extends Composite {
|
|||
|
||||
BBOXDV bbox = layer.getBbox();
|
||||
|
||||
try {
|
||||
|
||||
if(bbox!=null) {
|
||||
|
||||
if(!GWT.isProdMode()) {
|
||||
|
@ -124,6 +126,15 @@ public class LayersSectionViewer extends Composite {
|
|||
layerPanel.add(alert);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Alert alert = new Alert();
|
||||
alert.setType(AlertType.ERROR);
|
||||
alert.setHTML("Error on adding the layer to Map. Please check its WMS link: <br/>"+layer.getWMSLink());
|
||||
alert.getElement().getStyle().setProperty("wordBreak", "break-all");
|
||||
alert.setClose(false);
|
||||
layerPanel.add(alert);
|
||||
}
|
||||
|
||||
|
||||
String htmlLinkId = mapView.getPanelMapElementId() + "-image-download";
|
||||
|
||||
|
@ -138,18 +149,6 @@ public class LayersSectionViewer extends Composite {
|
|||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
// DOWNLOAD only the layer by Geoserver
|
||||
/*
|
||||
* Map<String, String> mapLayerURLs =
|
||||
* mapView.getLightOLSM().getLayerURLsProperty(); Collection<String> layerURLs =
|
||||
* mapLayerURLs.values(); ArrayList<String> layers = new
|
||||
* ArrayList<String>(layerURLs); exportPDF(layers.get(0)); String layerURL =
|
||||
* mapLayerURLs.get(layerDV.getLayerName()); GWT.log("layerDV name is: " +
|
||||
* layerDV.getLayerName()); if (layerURL != null) Window.open(layerURL,
|
||||
* "_blank", null);
|
||||
*/
|
||||
|
||||
downloadAttempt++;
|
||||
|
||||
if (downloadAttempt > 3) {
|
||||
|
@ -160,7 +159,6 @@ public class LayersSectionViewer extends Composite {
|
|||
// DOWNLOAD the OSM + layer by canvas
|
||||
downloadMap(mapView.getLightOLM().getMap(), mapView.getPanelMapElementId(), htmlLinkId, filename,
|
||||
mimeType);
|
||||
// mapExport(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -189,7 +187,7 @@ public class LayersSectionViewer extends Composite {
|
|||
*/
|
||||
public static native void downloadMap(ol.Map map, String mapPanelId, String linkId, String filename,
|
||||
String mimeType)/*-{
|
||||
console.log("map: " + map);
|
||||
//console.log("map: " + map);
|
||||
|
||||
map.once('rendercomplete', function() {
|
||||
var mapCanvas = $doc.createElement('canvas');
|
||||
|
|
|
@ -128,12 +128,13 @@ public class TimelineRelationPanel extends Composite {
|
|||
public void setTimelineContainerVisible(boolean bool) {
|
||||
timelineContainer.setVisible(bool);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when a project (box) is clicked into Timeline
|
||||
*/
|
||||
private void setSelectedProject(String theComposedProjectID) {
|
||||
this.selectedTimelineProjectID = theComposedProjectID;
|
||||
//selectedTimelineProjectID is the couple ProfileID,ProjectID
|
||||
// selectedTimelineProjectID is the couple ProfileID,ProjectID
|
||||
GWT.log("selectedTimelineProjectID: " + selectedTimelineProjectID);
|
||||
|
||||
if (selectedTimelineProjectID == null || selectedTimelineProjectID.isEmpty())
|
||||
|
@ -144,7 +145,8 @@ public class TimelineRelationPanel extends Composite {
|
|||
final String thePofileID = references[0];
|
||||
final String theProjectID = references[1];
|
||||
GeoportalItemReferences gir = new GeoportalItemReferences(theProjectID, thePofileID);
|
||||
ShowDetailsEvent showDetailsEvent = new ShowDetailsEvent(gir, null, false, false, EVENT_SOURCE.LOCATE_FROM_TIMELINE);
|
||||
ShowDetailsEvent showDetailsEvent = new ShowDetailsEvent(gir, null, false, false,
|
||||
EVENT_SOURCE.LOCATE_FROM_TIMELINE);
|
||||
showDetailsEvent.setEventFromTimeline(true);
|
||||
GWT.log("fireEvent: " + showDetailsEvent);
|
||||
|
||||
|
@ -157,19 +159,19 @@ public class TimelineRelationPanel extends Composite {
|
|||
|
||||
public static native String instanceTimeline(String idDivContainer, JSONArray jsonItems,
|
||||
TimelineRelationPanel instance) /*-{
|
||||
console.log('showTimeline_instanceTimeline for json items: '
|
||||
+ jsonItems);
|
||||
console.log('showing timeline');
|
||||
//console.log('showTimeline_instanceTimeline for json items: '+jsonItems);
|
||||
|
||||
console.log("showTimeline_template: " + $wnd.templateHandlebars);
|
||||
//console.log("showTimeline_template: " + $wnd.templateHandlebars);
|
||||
|
||||
// DOM element where the Timeline will be attached
|
||||
var container = $doc.getElementById(idDivContainer);
|
||||
|
||||
console.log("showTimeline_container: " + container);
|
||||
//console.log("showTimeline_container: " + container);
|
||||
|
||||
var myArray = $wnd.JSON.parse(jsonItems);
|
||||
|
||||
console.log("showTimeline_jsonItems: " + myArray);
|
||||
//console.log("showTimeline_jsonItems: " + myArray);
|
||||
|
||||
var container = $doc.getElementById(idDivContainer);
|
||||
|
||||
|
|
|
@ -313,9 +313,9 @@ public class SearchFacilityUI extends Composite {
|
|||
message += ". ";
|
||||
}
|
||||
|
||||
if (returnedItems > 0) {
|
||||
message += "On the map you can see all the projects with a centroid matching the query";
|
||||
}
|
||||
// if (returnedItems > 0) {
|
||||
// message += "On the map you can see all the projects with a centroid matching the query";
|
||||
// }
|
||||
|
||||
HTML resultMessage = new HTML(message);
|
||||
resultMessage.getElement().addClassName("search_result_msg");
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
|
|||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent;
|
||||
|
@ -9,6 +10,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetai
|
|||
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
|
@ -19,6 +21,7 @@ import com.github.gwtbootstrap.client.ui.constants.IconType;
|
|||
import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.Style.FontWeight;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
|
@ -32,21 +35,33 @@ import com.google.gwt.event.dom.client.DropEvent;
|
|||
import com.google.gwt.event.dom.client.DropHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.FlexTable;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class DragDropLayer extends FlowPanel {
|
||||
|
||||
private static final String _22PX = "22px";
|
||||
private static DragDropLayer dragging = null;
|
||||
private static DragDropLayer draggingTarget = null;
|
||||
final boolean droppable;
|
||||
private Label labelLayerName;
|
||||
private Image imgLayerVisible = new Image(GNAImages.ICONS.layerVisible());
|
||||
private Image imgLayerInvisible = new Image(GNAImages.ICONS.layerInvisible());
|
||||
|
||||
private Image imgLocate = new Image(GNAImages.ICONS.locate());
|
||||
private Image imgLocateNone = new Image(GNAImages.ICONS.locateNone());
|
||||
private boolean locateEnabled = false;
|
||||
private HTML buttonLocate = new HTML();
|
||||
|
||||
private DragDropLayer INSTANCE = this;
|
||||
|
||||
private LoaderIcon loaderIcon = new LoaderIcon("Loading features", null);
|
||||
|
||||
private Button draggableButton = new Button();
|
||||
private HandlerManager applicationBus;
|
||||
private LayerObject layerObject;
|
||||
|
@ -60,6 +75,26 @@ public class DragDropLayer extends FlowPanel {
|
|||
this.layerObject = layerObject;
|
||||
this.layerItem = layerObject.getLayerItem();
|
||||
GWT.log("DragDropLayer for projectDV: " + layerObject.getProjectDV());
|
||||
|
||||
// Checking the spatial reference
|
||||
if (layerObject.getProjectDV() != null && layerObject.getProjectDV().getSpatialReference() == null) {
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getSpatialReference(layerObject.getProfileID(),
|
||||
layerObject.getProjectID(), new AsyncCallback<GeoJSON>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(GeoJSON result) {
|
||||
if (result != null)
|
||||
layerObject.getProjectDV().setSpatialReference(result);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String referProjectID = "Project ID: " + layerObject.getProjectDV().getId();
|
||||
labelProject = new com.google.gwt.user.client.ui.Label("");
|
||||
|
@ -74,8 +109,8 @@ public class DragDropLayer extends FlowPanel {
|
|||
if (result != null) {
|
||||
for (String key : result.keySet()) {
|
||||
result.get(key);
|
||||
//referProject = key + ": " + result.get(key);
|
||||
realProjectName = result.get(key)+"";
|
||||
// referProject = key + ": " + result.get(key);
|
||||
realProjectName = result.get(key) + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -119,26 +154,57 @@ public class DragDropLayer extends FlowPanel {
|
|||
|
||||
RangeSlider rs = new RangeSlider(applicationBus, layerItem);
|
||||
rs.getElement().addClassName("range-slider");
|
||||
FlexTable ft = new FlexTable();
|
||||
ft.setWidget(0, 0, draggableButton);
|
||||
|
||||
// FlexTable ft = new FlexTable();
|
||||
// ft.setWidget(0, 0, draggableButton);
|
||||
draggableButton.setTitle("Drag and Drop me up or down to change my position on the Map");
|
||||
|
||||
imgLayerVisible.getElement().addClassName("layer-visibility-st");
|
||||
imgLayerInvisible.getElement().addClassName("layer-visibility-st");
|
||||
|
||||
imgLocate.setWidth(_22PX);
|
||||
imgLocate.setHeight(_22PX);
|
||||
imgLocateNone.setWidth(_22PX);
|
||||
imgLocateNone.setHeight(_22PX);
|
||||
imgLocate.getElement().addClassName("layer-visibility-st");
|
||||
imgLocateNone.getElement().addClassName("layer-visibility-st");
|
||||
setLocateEnabledButtonImage();
|
||||
|
||||
setLayerVisibilityButtonImage();
|
||||
|
||||
// labelLayerName.getElement().getStyle().setMarginLeft(10, Unit.PX);
|
||||
ft.setWidget(0, 1, buttonLayerVisibility);
|
||||
ft.setWidget(0, 2, labelProject);
|
||||
|
||||
if(layerObject.getProjectDV().getTemporalReference()!=null) {
|
||||
VerticalPanel vp = new VerticalPanel();
|
||||
VerticalPanel vpInner = new VerticalPanel();
|
||||
HorizontalPanel hp0 = new HorizontalPanel();
|
||||
HorizontalPanel hpFunct = new HorizontalPanel();
|
||||
vpInner.getElement().getStyle().setMarginLeft(47, Unit.PX);
|
||||
|
||||
hp0.add(draggableButton);
|
||||
labelProject.getElement().getStyle().setMarginLeft(10, Unit.PX);
|
||||
labelProject.getElement().getStyle().setFontWeight(FontWeight.BOLD);
|
||||
hp0.add(labelProject);
|
||||
hpFunct.add(buttonLayerVisibility);
|
||||
hpFunct.add(buttonLocate);
|
||||
hpFunct.add(loaderIcon);
|
||||
setVisibleLoaderFeatures(false, null);
|
||||
|
||||
if (layerObject.getProjectDV().getTemporalReference() != null) {
|
||||
TemporalReferenceDV tempRef = layerObject.getProjectDV().getTemporalReference();
|
||||
ft.setWidget(ft.getRowCount()+1, 2, new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
// ft.setWidget(ft.getRowCount() + 1, 2, new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
vpInner.add(new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
||||
}
|
||||
|
||||
ft.setWidget(ft.getRowCount()+1, 2, labelLayerName);
|
||||
ft.setWidget(ft.getRowCount()+1, 2, new SimplePanel(rs));
|
||||
add(ft);
|
||||
|
||||
vpInner.add(labelLayerName);
|
||||
// vpInner.add(new SimplePanel(rs));
|
||||
|
||||
vp.add(hp0);
|
||||
hpFunct.getElement().getStyle().setMarginTop(5, Unit.PX);
|
||||
vpInner.add(hpFunct);
|
||||
vpInner.add(new SimplePanel(rs));
|
||||
vp.add(vpInner);
|
||||
|
||||
add(vp);
|
||||
|
||||
// add(ft);
|
||||
draggableButton.setIcon(IconType.MOVE);
|
||||
|
||||
buttonLayerVisibility.addClickHandler(new ClickHandler() {
|
||||
|
@ -147,20 +213,48 @@ public class DragDropLayer extends FlowPanel {
|
|||
public void onClick(ClickEvent event) {
|
||||
layerVisibility = !layerVisibility;
|
||||
setLayerVisibilityButtonImage();
|
||||
DoActionOnDetailLayersEvent dae = new DoActionOnDetailLayersEvent(DO_LAYER_ACTION.VISIBILITY,
|
||||
layerItem);
|
||||
DoActionOnDetailLayersEvent dae = new DoActionOnDetailLayersEvent(DO_LAYER_ACTION.VISIBILITY, layerItem,
|
||||
layerObject);
|
||||
dae.setVisibility(layerVisibility);
|
||||
applicationBus.fireEvent(dae);
|
||||
}
|
||||
});
|
||||
|
||||
buttonLocate.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
locateEnabled = !locateEnabled;
|
||||
setLocateEnabledButtonImage();
|
||||
DoActionOnDetailLayersEvent dae = new DoActionOnDetailLayersEvent(DO_LAYER_ACTION.LOCATE_LAYER,
|
||||
layerItem, layerObject);
|
||||
dae.setUIEventSource(INSTANCE);
|
||||
setVisibleLoaderFeatures(true, null);
|
||||
applicationBus.fireEvent(dae);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setLayerVisibilityButtonImage() {
|
||||
buttonLayerVisibility.getElement().removeAllChildren();
|
||||
if (layerVisibility) {
|
||||
buttonLayerVisibility.getElement().appendChild(imgLayerVisible.getElement());
|
||||
buttonLayerVisibility.setTitle("Hide the layer");
|
||||
} else {
|
||||
buttonLayerVisibility.getElement().appendChild(imgLayerInvisible.getElement());
|
||||
buttonLayerVisibility.setTitle("Show the layer");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setLocateEnabledButtonImage() {
|
||||
buttonLocate.getElement().removeAllChildren();
|
||||
if (locateEnabled) {
|
||||
buttonLocate.getElement().appendChild(imgLocate.getElement());
|
||||
buttonLocate.setTitle("Unselect the layer features");
|
||||
} else {
|
||||
buttonLocate.getElement().appendChild(imgLocateNone.getElement());
|
||||
buttonLocate.setTitle("Highlight the layer features");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -226,7 +320,7 @@ public class DragDropLayer extends FlowPanel {
|
|||
tree.insert(source, targetIndex);
|
||||
// target.setState(true);
|
||||
DoActionOnDetailLayersEvent actionSwapLayers = new DoActionOnDetailLayersEvent(
|
||||
DO_LAYER_ACTION.SWAP, layerItem);
|
||||
DO_LAYER_ACTION.SWAP, layerItem, layerObject);
|
||||
SwapLayer swapLS = new DoActionOnDetailLayersEvent.SwapLayer(dragging.getLayerItem(),
|
||||
sourceIndex);
|
||||
SwapLayer swapLT = new DoActionOnDetailLayersEvent.SwapLayer(draggingTarget.getLayerItem(),
|
||||
|
@ -245,4 +339,17 @@ public class DragDropLayer extends FlowPanel {
|
|||
return layerItem;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the visible loader features.
|
||||
*
|
||||
* @param bool the bool
|
||||
* @param msg the msg
|
||||
*/
|
||||
public void setVisibleLoaderFeatures(boolean bool, String msg) {
|
||||
loaderIcon.setVisible(bool);
|
||||
if(msg!=null)
|
||||
loaderIcon.setText(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RangeSlider extends Composite {
|
|||
if (Event.ONMOUSEUP == event.getTypeInt()) {
|
||||
GWT.log("Event.ONMOUSEUP");
|
||||
DoActionOnDetailLayersEvent actionChangeOpacity = new DoActionOnDetailLayersEvent(
|
||||
DO_LAYER_ACTION.OPACITY, layer);
|
||||
DO_LAYER_ACTION.OPACITY, layer, null);
|
||||
int value = Integer.parseInt((String) theSlider.getPropertyObject("value"));
|
||||
//GWT.log("opacity int value: "+value);
|
||||
double opacity = (double) ((double) value/100);
|
||||
|
|
|
@ -396,7 +396,7 @@ public class DialogShareableLink extends Composite {
|
|||
private native void copyToClipboard(String myDivId) /*-{
|
||||
|
||||
var copyText = $doc.getElementById(myDivId);
|
||||
console.log("text copied is :" + copyText.value);
|
||||
//console.log("text copied is :" + copyText.value);
|
||||
copyText.select();
|
||||
//For mobile devices
|
||||
copyText.setSelectionRange(0, 99999);
|
||||
|
|
|
@ -3,6 +3,10 @@ package org.gcube.portlets.user.geoportaldataviewer.server;
|
|||
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.projects;
|
||||
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.useCaseDescriptors;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -60,6 +64,7 @@ import org.gcube.application.geoportalcommon.util.URLParserUtil;
|
|||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerService;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.gis.GisMakers;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.gis.WMSUrlValidator;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.GeoportalServiceIdentityProxy;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.server.util.ContextRequest;
|
||||
|
@ -72,6 +77,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedData
|
|||
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.faults.ControlledError;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObjectType;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
||||
|
@ -347,7 +353,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
* @param layerObjects the layer objects
|
||||
* @param mapSrsName the map srs name
|
||||
* @param selectBBOX the select BBOX
|
||||
* @param maxWFSFeature the max WFS feature
|
||||
* @param maxWFSFeature the max WFS feature. If 0 means all feature
|
||||
* @param zoomLevel the zoom level
|
||||
* @return the WFS features
|
||||
*/
|
||||
|
@ -769,10 +775,11 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
LOG.info("Access policy for discovering the layers is: " + accessPolicy);
|
||||
|
||||
String filesetParentJSONPath = null;
|
||||
|
||||
//(see ticket #24390)
|
||||
|
||||
// (see ticket #24390)
|
||||
if (accessPolicy.equals(ACCESS_POLICY.OPEN)) {
|
||||
// Filtering for ACCESS_POLICY.OPEN from the fileset when the username is not in session. IAM
|
||||
// Filtering for ACCESS_POLICY.OPEN from the fileset when the username is not in
|
||||
// session. IAM
|
||||
// identity is running, no logged in user.
|
||||
filesetParentJSONPath = String.format("%s..%s[?(@._access._policy=='%s')]",
|
||||
Geoportal_JSON_Mapper.JSON_$_POINTER, Geoportal_JSON_Mapper.FILESET, accessPolicy);
|
||||
|
@ -894,10 +901,10 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
theProjectDV.setProfileName(ucd.getName());
|
||||
|
||||
TemporalReferenceDV temporalReference = temporalReferenceForProject(theProject);
|
||||
|
||||
|
||||
if (temporalReference == null)
|
||||
temporalReference = new TemporalReferenceDV();
|
||||
|
||||
|
||||
theProjectDV.setTemporalReference(temporalReference);
|
||||
|
||||
ProjectView projectView = Geoportal_JSON_Mapper.loadProjectView(theProjectDV, scope, userName);
|
||||
|
@ -1269,7 +1276,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
break;
|
||||
|
||||
Entry<String, Object> entry = entrySetsIt.next();
|
||||
documentAsMap.put(entry.getKey(), entry.getValue()!=null?entry.getValue().toString():null);
|
||||
documentAsMap.put(entry.getKey(), entry.getValue() != null ? entry.getValue().toString() : null);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -1539,4 +1546,84 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the WFS request.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features. If 0 means all feature
|
||||
* @param outputFormat the output format
|
||||
* @return the WFS request
|
||||
*/
|
||||
@Override
|
||||
public String getWFSRequest(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
|
||||
String outputFormat) {
|
||||
LOG.info("getWFSRequest called");
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("getWFSRequest parameters layerItem name: " + layerItem.getName(), ", mapSrsName: " + mapSrsName
|
||||
+ ", mapBBOX: " + mapBBOX + ", maxFeatures: " + maxFeatures + ", outputFormat: " + outputFormat);
|
||||
}
|
||||
String url = GisMakers.buildWFSFeatureQuery(layerItem, mapSrsName, mapBBOX, maxFeatures, outputFormat);
|
||||
LOG.info("returning WFSRequest: " + url);
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the WFS response.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features
|
||||
* @param outputFormat the output format
|
||||
* @return the WFS response
|
||||
*/
|
||||
@Override
|
||||
public String getWFSResponse(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures,
|
||||
String outputFormat) {
|
||||
LOG.info("getWFSResponse called");
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("getWFSResponse parameters layerItem name: " + layerItem.getName(), ", mapSrsName: " + mapSrsName
|
||||
+ ", mapBBOX: " + mapBBOX + ", maxFeatures: " + maxFeatures + ", outputFormat: " + outputFormat);
|
||||
}
|
||||
|
||||
String url = getWFSRequest(layerItem, mapSrsName, mapBBOX, maxFeatures, outputFormat);
|
||||
StringBuffer response = new StringBuffer();
|
||||
String theResponseString = "";
|
||||
HttpURLConnection con = null;
|
||||
LOG.debug("Built URL: " + url);
|
||||
try {
|
||||
URL obj = new URL(url);
|
||||
con = (HttpURLConnection) obj.openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
int responseCode = con.getResponseCode();
|
||||
LOG.debug("GET Response Code: " + responseCode);
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) { // success
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
} else {
|
||||
LOG.info("GET request did not work.");
|
||||
}
|
||||
|
||||
theResponseString = response.toString();
|
||||
//LOG.trace(theResponseString);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("getWFSResponse is empty? " + theResponseString.isEmpty());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error on performing the request to URL: " + url, e);
|
||||
} finally {
|
||||
|
||||
}
|
||||
return theResponseString;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -577,6 +577,7 @@ public class Geoportal_JSON_Mapper {
|
|||
projectView.addSectionView(sectionView);
|
||||
}
|
||||
|
||||
LOG.debug("returning the projectView: " + projectView);
|
||||
return projectView;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,18 +7,17 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* The Class URLMakers.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 29, 2020
|
||||
* Oct 29, 2020
|
||||
*/
|
||||
public class GisMakers {
|
||||
|
||||
public static final String CQL_FILTER_PARAMETER = "CQL_FILTER";
|
||||
|
||||
|
||||
public static final String GEOM_NAME_BOUNDED = "geom";
|
||||
|
||||
// MAP SERVER PIVOT
|
||||
|
@ -30,53 +29,56 @@ public class GisMakers {
|
|||
public static final String CSV = "csv";
|
||||
|
||||
public static final String JSON = "json";
|
||||
|
||||
|
||||
private static String[][] a = { { "\\?", "%3F" }, { "&", "%26" }, };
|
||||
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(GisMakers.class);
|
||||
|
||||
|
||||
/**
|
||||
* The Enum COORDINATE_FORMAT.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Oct 29, 2020
|
||||
* Oct 29, 2020
|
||||
*/
|
||||
public static enum COORDINATE_FORMAT {
|
||||
XY, YX
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Builds the WFS feature query.
|
||||
*
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features
|
||||
* @param layerItem the layer item
|
||||
* @param mapSrsName the map srs name
|
||||
* @param mapBBOX the map BBOX
|
||||
* @param maxFeatures the max features
|
||||
* @param outputFormat the output format
|
||||
* @return the string
|
||||
*/
|
||||
public static String buildWFSFeatureQuery(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, int maxFeatures, String outputFormat) {
|
||||
public static String buildWFSFeatureQuery(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX,
|
||||
int maxFeatures, String outputFormat) {
|
||||
|
||||
String link = layerItem.getMapServerHost();
|
||||
LOG.debug("Map server host URL: " + link);
|
||||
LOG.debug("CQL filter is: " + layerItem.getCqlFilter());
|
||||
LOG.debug("MAX FEATURES: " + maxFeatures);
|
||||
LOG.debug("BBOX: " + mapBBOX);
|
||||
LOG.debug("Output Format: " + outputFormat);
|
||||
|
||||
String outputformat = null;
|
||||
String boundingBox = "";
|
||||
String boundingBox = null;
|
||||
|
||||
// CASE MAP SERVER
|
||||
SERVERTYPE mapserverType = MapServerRecognize.recongnize(layerItem);
|
||||
LOG.debug("Recongnized SERVERTYPE: " + mapserverType);
|
||||
|
||||
|
||||
if (mapserverType != null) {
|
||||
if (mapserverType.equals(SERVERTYPE.MAPSERVER)) {
|
||||
LOG.debug("wms url contains wxs is a map server? no appending /wfs ");
|
||||
outputformat = MapServerRecognize.outputFormatRecognize(SERVERTYPE.MAPSERVER, outputFormat);
|
||||
boundingBox = BBOX_FORMAT(COORDINATE_FORMAT.YX, ",",mapBBOX.getLowerLeftX(),mapBBOX.getLowerLeftY(),mapBBOX.getUpperRightX(),mapBBOX.getUpperRightY()); // USE AXIS XY
|
||||
if (mapBBOX != null)
|
||||
boundingBox = BBOX_FORMAT(COORDINATE_FORMAT.YX, ",", mapBBOX.getLowerLeftX(),
|
||||
mapBBOX.getLowerLeftY(), mapBBOX.getUpperRightX(), mapBBOX.getUpperRightY()); // USE AXIS XY
|
||||
// DEBUG
|
||||
LOG.debug("SERVERTYPE.MAPSERVER outputformat: " + outputformat);
|
||||
LOG.debug("SERVERTYPE.MAPSERVER srsName: " + mapSrsName);
|
||||
|
@ -85,8 +87,10 @@ public class GisMakers {
|
|||
LOG.debug("is geoserver appending suffix /wfs if is not present");
|
||||
link += link.endsWith("wfs") ? "" : "/wfs";
|
||||
outputformat = MapServerRecognize.outputFormatRecognize(SERVERTYPE.GEOSEVER, outputFormat);
|
||||
mapSrsName = "urn:x-ogc:def:crs:"+mapSrsName;
|
||||
boundingBox = BBOX_FORMAT(COORDINATE_FORMAT.YX, ",",mapBBOX.getLowerLeftX(),mapBBOX.getLowerLeftY(),mapBBOX.getUpperRightX(),mapBBOX.getUpperRightY()); // USE AXIS XY
|
||||
mapSrsName = "urn:x-ogc:def:crs:" + mapSrsName;
|
||||
if (mapBBOX != null)
|
||||
boundingBox = BBOX_FORMAT(COORDINATE_FORMAT.YX, ",", mapBBOX.getLowerLeftX(),
|
||||
mapBBOX.getLowerLeftY(), mapBBOX.getUpperRightX(), mapBBOX.getUpperRightY()); // USE AXIS XY
|
||||
// DEBUG
|
||||
LOG.debug("SERVERTYPE.GEOSEVER outputformat: " + outputformat);
|
||||
LOG.debug("SERVERTYPE.GEOSEVER srsName: " + mapSrsName);
|
||||
|
@ -98,23 +102,31 @@ public class GisMakers {
|
|||
// + (outputformat == null ? "" : "&OUTPUTFORMAT=" + outputformat);
|
||||
//
|
||||
|
||||
link += "?"+
|
||||
URLParserUtil.addParameterToQueryString(WFSGetFeature.SERVICE.getParameter(), WFSGetFeature.SERVICE.getValue(), false, true)+
|
||||
URLParserUtil.addParameterToQueryString(WFSGetFeature.VERSION.getParameter(), WFSGetFeature.VERSION.getValue(), false, true)+
|
||||
URLParserUtil.addParameterToQueryString(WFSGetFeature.REQUEST.getParameter(), WFSGetFeature.REQUEST.getValue(), false, true)+
|
||||
URLParserUtil.addParameterToQueryString(WFSGetFeature.SRSNAME.getParameter(), mapSrsName, false, true)+
|
||||
URLParserUtil.addParameterToQueryString(WFSGetFeature.TYPENAME.getParameter(), layerItem.getName(), false, true)+
|
||||
(maxFeatures == 0 ? "" : URLParserUtil.addParameterToQueryString(WFSGetFeature.MAXFEATURES.getParameter(), maxFeatures+"", false, true))+
|
||||
(outputformat == null ? "" : URLParserUtil.addParameterToQueryString(WFSGetFeature.OUTPUTFORMAT.getParameter(), outputformat, false, false));
|
||||
|
||||
|
||||
link += "?"
|
||||
+ URLParserUtil.addParameterToQueryString(WFSGetFeature.SERVICE.getParameter(),
|
||||
WFSGetFeature.SERVICE.getValue(), false, true)
|
||||
+ URLParserUtil.addParameterToQueryString(WFSGetFeature.VERSION.getParameter(),
|
||||
WFSGetFeature.VERSION.getValue(), false, true)
|
||||
+ URLParserUtil.addParameterToQueryString(WFSGetFeature.REQUEST.getParameter(),
|
||||
WFSGetFeature.REQUEST.getValue(), false, true)
|
||||
+ URLParserUtil.addParameterToQueryString(WFSGetFeature.SRSNAME.getParameter(), mapSrsName, false, true)
|
||||
+ URLParserUtil.addParameterToQueryString(WFSGetFeature.TYPENAME.getParameter(), layerItem.getName(),
|
||||
false, true)
|
||||
+ (maxFeatures == 0 ? ""
|
||||
: URLParserUtil.addParameterToQueryString(WFSGetFeature.MAXFEATURES.getParameter(),
|
||||
maxFeatures + "", false, true))
|
||||
+ (outputformat == null ? ""
|
||||
: URLParserUtil.addParameterToQueryString(WFSGetFeature.OUTPUTFORMAT.getParameter(),
|
||||
outputformat, false, false));
|
||||
|
||||
if (layerItem.getCqlFilter() != null && !layerItem.getCqlFilter().isEmpty()) {
|
||||
if (layerItem.getCqlFilter().contains("BBOX("+GEOM_NAME_BOUNDED+"")) {
|
||||
if (layerItem.getCqlFilter().contains("BBOX(" + GEOM_NAME_BOUNDED + "")) {
|
||||
// THE BBOX IS ALREADY USED INTO CQL FILTERING, SO USING IT DIRECTLY
|
||||
link += "&" + CQL_FILTER_PARAMETER + "=" + layerItem.getCqlFilter();
|
||||
} else {
|
||||
// I NEED TO ENCODE THE BBOX INTO CQL FILTERING,
|
||||
String cqlFilterValue = "BBOX("+GEOM_NAME_BOUNDED+"," + boundingBox + ")" + " AND " + layerItem.getCqlFilter();
|
||||
String cqlFilterValue = "BBOX(" + GEOM_NAME_BOUNDED + "," + boundingBox + ")" + " AND "
|
||||
+ layerItem.getCqlFilter();
|
||||
|
||||
link += "&" + CQL_FILTER_PARAMETER + "=" + cqlFilterValue;
|
||||
}
|
||||
|
@ -172,44 +184,30 @@ public class GisMakers {
|
|||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
*
|
||||
* @param format the format
|
||||
* @param format the format
|
||||
* @param separator the separator
|
||||
* @return the string
|
||||
*/
|
||||
public static String BBOX_FORMAT(COORDINATE_FORMAT format, String separator, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY) {
|
||||
|
||||
if(format==null)
|
||||
public static String BBOX_FORMAT(COORDINATE_FORMAT format, String separator, double lowerLeftX, double lowerLeftY,
|
||||
double upperRightX, double upperRightY) {
|
||||
|
||||
if (format == null)
|
||||
format = COORDINATE_FORMAT.XY;
|
||||
|
||||
if(separator==null)
|
||||
|
||||
if (separator == null)
|
||||
separator = ",";
|
||||
|
||||
|
||||
switch (format) {
|
||||
case XY:
|
||||
return String.format("%s%s%s%s%s%s%s",
|
||||
String.valueOf(lowerLeftX),
|
||||
separator,
|
||||
String.valueOf(lowerLeftY),
|
||||
separator,
|
||||
String.valueOf(upperRightX),
|
||||
separator,
|
||||
String.valueOf(upperRightY)
|
||||
);
|
||||
return String.format("%s%s%s%s%s%s%s", String.valueOf(lowerLeftX), separator, String.valueOf(lowerLeftY),
|
||||
separator, String.valueOf(upperRightX), separator, String.valueOf(upperRightY));
|
||||
case YX:
|
||||
return String.format("%s%s%s%s%s%s%s",
|
||||
String.valueOf(lowerLeftY),
|
||||
separator,
|
||||
String.valueOf(lowerLeftX),
|
||||
separator,
|
||||
String.valueOf(upperRightY),
|
||||
separator,
|
||||
String.valueOf(upperRightX)
|
||||
);
|
||||
return String.format("%s%s%s%s%s%s%s", String.valueOf(lowerLeftY), separator, String.valueOf(lowerLeftX),
|
||||
separator, String.valueOf(upperRightY), separator, String.valueOf(upperRightX));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -363,6 +363,9 @@ body {
|
|||
|
||||
.dand-layer {
|
||||
width: 400px;
|
||||
border: 1px solid #ccc !important;
|
||||
padding: 5px 0px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.range-slider {
|
||||
|
|
Loading…
Reference in New Issue