merged with master at a6ac952994
This commit is contained in:
parent
3644685fe5
commit
3a7005728f
|
@ -62,6 +62,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,6 +234,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -317,6 +320,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -402,6 +406,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -487,6 +492,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -509,7 +515,7 @@
|
||||||
|
|
||||||
|
|
||||||
<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-mapper-1.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
|
<dependent-module archiveName="geoportal-data-common-2.2.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
|
||||||
|
@ -575,6 +581,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -660,6 +667,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -745,6 +753,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -830,6 +839,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
- Supported the cross-filtering [#25074]
|
- Supported the cross-filtering [#25074]
|
||||||
- Supported the grouped custom layers [#25110]
|
- Supported the grouped custom layers [#25110]
|
||||||
|
- Managed the (WMS) Layer Style facility [#25066]
|
||||||
|
|
||||||
## [v3.4.0] - 2023-05-11
|
## [v3.4.0] - 2023-05-11
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<version>1.1.0</version>
|
<version>1.2.0</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowPopupOnCent
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent.EVENT_TYPE;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEvent.EVENT_TYPE;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEventHandler;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.TimelineProjectRelationsEventHandler;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.CloseCollectionEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.CloseCollectionEvent;
|
||||||
|
@ -947,6 +949,30 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
applicationBus.addHandler(UpdateLayerToMapEvent.TYPE, new UpdateLayerToMapEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdateLayer(UpdateLayerToMapEvent updateLayerToMapEvent) {
|
||||||
|
|
||||||
|
if (updateLayerToMapEvent != null && updateLayerToMapEvent.getOperation() != null) {
|
||||||
|
|
||||||
|
if (updateLayerToMapEvent.getLayerType().equals(
|
||||||
|
org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEvent.LAYER_TYPE.INDEX)) {
|
||||||
|
|
||||||
|
switch (updateLayerToMapEvent.getOperation()) {
|
||||||
|
case STYLE:
|
||||||
|
olMapMng.getOLMap().setLayerStyleForIndex(updateLayerToMapEvent.getLayerName(),
|
||||||
|
updateLayerToMapEvent.getValue());
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,6 +26,7 @@ public class GeoportalDataViewerConstants {
|
||||||
public static final String GET_ZOOM = OpenLayersMapParameters.OL_MAP_PARAM.zoom.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();
|
public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name();
|
||||||
|
|
||||||
|
public static final Double INITIAL_LAYER_OPACITY = 0.8;
|
||||||
public static final int SEARCH_LIMIT_RESULTS_TO_MAXIMUM = 50;
|
public static final int SEARCH_LIMIT_RESULTS_TO_MAXIMUM = 50;
|
||||||
|
|
||||||
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
public static final DateTimeFormat DATE_TIME_FORMAT = DateTimeFormat.getFormat("dd MMMM yyyy");
|
||||||
|
|
|
@ -553,7 +553,7 @@ public class LayerManager {
|
||||||
theLo = lo;
|
theLo = lo;
|
||||||
mapOtherLayerObjects.put(layerNameKey, theLo);
|
mapOtherLayerObjects.put(layerNameKey, theLo);
|
||||||
GWT.log("PROJECT_LAYER mapOtherLayerObjects is: " + mapOtherLayerObjects);
|
GWT.log("PROJECT_LAYER mapOtherLayerObjects is: " + mapOtherLayerObjects);
|
||||||
olMap.addWMSDetailLayer(layerItem);
|
olMap.addWMSDetailLayer(layerItem, GeoportalDataViewerConstants.INITIAL_LAYER_OPACITY);
|
||||||
overlayLayerManager.addLayerItem(theLo);
|
overlayLayerManager.addLayerItem(theLo);
|
||||||
} else {
|
} else {
|
||||||
GWT.log("Skipping " + lo.getType() + " layer " + theLo.getLayerItem().getName()
|
GWT.log("Skipping " + lo.getType() + " layer " + theLo.getLayerItem().getName()
|
||||||
|
|
|
@ -0,0 +1,134 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class UpdateLayerToMapEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 15, 2023
|
||||||
|
*/
|
||||||
|
public class UpdateLayerToMapEvent extends GwtEvent<UpdateLayerToMapEventHandler> {
|
||||||
|
public static Type<UpdateLayerToMapEventHandler> TYPE = new Type<UpdateLayerToMapEventHandler>();
|
||||||
|
private GCubeCollection collection;
|
||||||
|
private String layerName;
|
||||||
|
private REQUEST_PARAMETER operation;
|
||||||
|
private String value;
|
||||||
|
private LAYER_TYPE layerType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Enum REQUEST_PARAMETER.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 15, 2023
|
||||||
|
*/
|
||||||
|
public static enum REQUEST_PARAMETER {
|
||||||
|
STYLE
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Enum LAYER_TYPE.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 15, 2023
|
||||||
|
*/
|
||||||
|
public static enum LAYER_TYPE {
|
||||||
|
INDEX, DETAILS
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new adds the layer to map event.
|
||||||
|
*
|
||||||
|
* @param collection the collection
|
||||||
|
* @param layerName the layer name
|
||||||
|
* @param type the type
|
||||||
|
*/
|
||||||
|
public UpdateLayerToMapEvent(GCubeCollection collection, String layerName, LAYER_TYPE type) {
|
||||||
|
this.collection = collection;
|
||||||
|
this.layerName = layerName;
|
||||||
|
this.layerType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<UpdateLayerToMapEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the operation.
|
||||||
|
*
|
||||||
|
* @param operation the operation
|
||||||
|
* @param value the value
|
||||||
|
*/
|
||||||
|
public void setOperation(REQUEST_PARAMETER operation, String value) {
|
||||||
|
this.operation = operation;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value.
|
||||||
|
*
|
||||||
|
* @return the value
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the layer type.
|
||||||
|
*
|
||||||
|
* @return the layer type
|
||||||
|
*/
|
||||||
|
public LAYER_TYPE getLayerType() {
|
||||||
|
return layerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the operation.
|
||||||
|
*
|
||||||
|
* @return the operation
|
||||||
|
*/
|
||||||
|
public REQUEST_PARAMETER getOperation() {
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the layer name.
|
||||||
|
*
|
||||||
|
* @return the layer name
|
||||||
|
*/
|
||||||
|
public String getLayerName() {
|
||||||
|
return layerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the collection.
|
||||||
|
*
|
||||||
|
* @return the collection
|
||||||
|
*/
|
||||||
|
public GCubeCollection getCollection() {
|
||||||
|
return collection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(UpdateLayerToMapEventHandler handler) {
|
||||||
|
handler.onUpdateLayer(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataviewer.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface UpdateLayerToMapEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 15, 2023
|
||||||
|
*/
|
||||||
|
public interface UpdateLayerToMapEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On update layer.
|
||||||
|
*
|
||||||
|
* @param updateLayerToMapEvent the update layer to map event
|
||||||
|
*/
|
||||||
|
void onUpdateLayer(UpdateLayerToMapEvent updateLayerToMapEvent);
|
||||||
|
}
|
|
@ -527,8 +527,9 @@ public abstract class OpenLayerMap {
|
||||||
* Adds the WMS detail layer.
|
* Adds the WMS detail layer.
|
||||||
*
|
*
|
||||||
* @param layerItem the layer item
|
* @param layerItem the layer item
|
||||||
|
* @param initialOpacity the initial opacity
|
||||||
*/
|
*/
|
||||||
public void addWMSDetailLayer(LayerItem layerItem) {
|
public void addWMSDetailLayer(LayerItem layerItem, double initialOpacity) {
|
||||||
|
|
||||||
if (wmsDetailsLayerMap == null)
|
if (wmsDetailsLayerMap == null)
|
||||||
wmsDetailsLayerMap = new LinkedHashMap<String, Image>();
|
wmsDetailsLayerMap = new LinkedHashMap<String, Image>();
|
||||||
|
@ -562,6 +563,7 @@ public abstract class OpenLayerMap {
|
||||||
Image wmsLayer = new Image(layerOptions);
|
Image wmsLayer = new Image(layerOptions);
|
||||||
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.WMS_DETAIL) + wmsDetailsLayerMap.size() + 1;
|
int zIndex = layerOrder.getOffset(LayerOrder.LAYER_TYPE.WMS_DETAIL) + wmsDetailsLayerMap.size() + 1;
|
||||||
wmsLayer.setZIndex(zIndex);
|
wmsLayer.setZIndex(zIndex);
|
||||||
|
wmsLayer.setOpacity(initialOpacity);
|
||||||
map.addLayer(wmsLayer);
|
map.addLayer(wmsLayer);
|
||||||
wmsDetailsLayerMap.put(key, wmsLayer);
|
wmsDetailsLayerMap.put(key, wmsLayer);
|
||||||
|
|
||||||
|
@ -1128,6 +1130,23 @@ public abstract class OpenLayerMap {
|
||||||
layer.setVisible(visible);
|
layer.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLayerStyleForIndex(String layerName, String value) {
|
||||||
|
GWT.log("Setting style " + value + " for " + layerName);
|
||||||
|
|
||||||
|
Image indexWmsLayer = wmsLayerMap.get(layerName);
|
||||||
|
GWT.log("WMS layer is: " + indexWmsLayer);
|
||||||
|
|
||||||
|
if (indexWmsLayer != null) {
|
||||||
|
ImageWms imageWMSSource = indexWmsLayer.getSource();
|
||||||
|
ImageWmsParams imageWMSParams = imageWMSSource.getParams();
|
||||||
|
imageWMSParams.set("STYLES", value);
|
||||||
|
|
||||||
|
imageWMSSource.updateParams(imageWMSParams);
|
||||||
|
indexWmsLayer.setSource(imageWMSSource);
|
||||||
|
indexWmsLayer.changed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the WMS detail layer opacity.
|
* Sets the WMS detail layer opacity.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
|
package org.gcube.portlets.user.geoportaldataviewer.client.ui.dandd;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
||||||
|
@ -38,8 +39,8 @@ public class RangeSlider extends Composite {
|
||||||
sliderId = "slider-" + Random.nextInt();
|
sliderId = "slider-" + Random.nextInt();
|
||||||
theSlider.addClassName("slider");
|
theSlider.addClassName("slider");
|
||||||
theSlider.setId(sliderId);
|
theSlider.setId(sliderId);
|
||||||
|
theSlider.setTitle("Set opacity of the layer");
|
||||||
theSlider.setTitle("Set opacity of "+layer.getName());
|
theSlider.setPropertyObject("value", GeoportalDataViewerConstants.INITIAL_LAYER_OPACITY*100);
|
||||||
|
|
||||||
bindEvents();
|
bindEvents();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@ import java.util.HashMap;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEvent.LAYER_TYPE;
|
||||||
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.UpdateLayerToMapEvent.REQUEST_PARAMETER;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.CloseCollectionEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.CloseCollectionEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.OpenCollectionEvent;
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.OpenCollectionEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
||||||
|
@ -18,6 +21,8 @@ import com.github.gwtbootstrap.client.ui.ListBox;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.dom.client.Style.FontWeight;
|
import com.google.gwt.dom.client.Style.FontWeight;
|
||||||
|
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.dom.client.ErrorEvent;
|
import com.google.gwt.event.dom.client.ErrorEvent;
|
||||||
|
@ -42,7 +47,6 @@ import com.google.gwt.user.client.ui.Label;
|
||||||
import com.google.gwt.user.client.ui.ScrollPanel;
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class LayerCollectionPanel.
|
* The Class LayerCollectionPanel.
|
||||||
*
|
*
|
||||||
|
@ -77,6 +81,12 @@ public class LayerCollectionPanel extends Composite {
|
||||||
|
|
||||||
private ListBox listBoxStyles = new ListBox();
|
private ListBox listBoxStyles = new ListBox();
|
||||||
|
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
|
private GCubeCollection gcubeCollection;
|
||||||
|
|
||||||
|
private HandlerManager applicationBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Interface LayerCollectionPanelUiBinder.
|
* The Interface LayerCollectionPanelUiBinder.
|
||||||
*
|
*
|
||||||
|
@ -93,8 +103,9 @@ public class LayerCollectionPanel extends Composite {
|
||||||
* @param coll the coll
|
* @param coll the coll
|
||||||
* @param applicationBus the application bus
|
* @param applicationBus the application bus
|
||||||
*/
|
*/
|
||||||
public LayerCollectionPanel(GCubeCollection coll, HandlerManager applicationBus) {
|
public LayerCollectionPanel(final GCubeCollection coll, HandlerManager applicationBus) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
this.applicationBus = applicationBus;
|
||||||
|
|
||||||
buttonLegend.setType(ButtonType.LINK);
|
buttonLegend.setType(ButtonType.LINK);
|
||||||
legendPanel.setVisible(false);
|
legendPanel.setVisible(false);
|
||||||
|
@ -112,18 +123,16 @@ public class LayerCollectionPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
||||||
GWT.log("Collection selector flag changed to value : " + event.toDebugString());
|
GWT.log("Collection selector flag changed to value : " + event.toDebugString());
|
||||||
|
|
||||||
// String collectionID = ((CheckBox) event.getSource()).getId().replace("gcubeCollectionSelector_",
|
|
||||||
// "");
|
|
||||||
|
|
||||||
GWT.log("Collection ID is : " + collectionID + ", event value: " + event.getValue());
|
GWT.log("Collection ID is : " + collectionID + ", event value: " + event.getValue());
|
||||||
if (event.getValue()) {
|
if (event.getValue()) {
|
||||||
// OPEN COLLECTION
|
// OPEN COLLECTION
|
||||||
applicationBus.fireEvent(new OpenCollectionEvent(collectionID));
|
applicationBus.fireEvent(new OpenCollectionEvent(collectionID));
|
||||||
|
enableLayerStyle(true);
|
||||||
} else {
|
} else {
|
||||||
// CLOSE COLLECTION
|
// CLOSE COLLECTION
|
||||||
legendPanel.clear();
|
hideStyleLegend();
|
||||||
legendPanel.setVisible(false);
|
resetLayerStyle();
|
||||||
|
enableLayerStyle(false);
|
||||||
applicationBus.fireEvent(new CloseCollectionEvent(collectionID));
|
applicationBus.fireEvent(new CloseCollectionEvent(collectionID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +141,7 @@ public class LayerCollectionPanel extends Composite {
|
||||||
basePanel.add(checkbox);
|
basePanel.add(checkbox);
|
||||||
|
|
||||||
ViewerConfiguration theConfig = GeoportalDataViewer.getStatus().getViewerConfig();
|
ViewerConfiguration theConfig = GeoportalDataViewer.getStatus().getViewerConfig();
|
||||||
GCubeCollection toOpen = theConfig.getAvailableCollections().get(collectionID);
|
final GCubeCollection toOpen = theConfig.getAvailableCollections().get(collectionID);
|
||||||
|
|
||||||
// Check if indexes is empty
|
// Check if indexes is empty
|
||||||
if (toOpen.getIndexes() == null || toOpen.getIndexes().isEmpty()) {
|
if (toOpen.getIndexes() == null || toOpen.getIndexes().isEmpty()) {
|
||||||
|
@ -140,6 +149,7 @@ public class LayerCollectionPanel extends Composite {
|
||||||
Window.alert("Cannot open collection index layer for " + toOpen.getUcd().getName() + ".");
|
Window.alert("Cannot open collection index layer for " + toOpen.getUcd().getName() + ".");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.gcubeCollection = toOpen;
|
||||||
// TODO Get Default Index Layer
|
// TODO Get Default Index Layer
|
||||||
// For now we just take the first - only 1 is expected
|
// For now we just take the first - only 1 is expected
|
||||||
IndexLayerDV layer = toOpen.getIndexes().get(0);
|
IndexLayerDV layer = toOpen.getIndexes().get(0);
|
||||||
|
@ -147,7 +157,7 @@ public class LayerCollectionPanel extends Composite {
|
||||||
|
|
||||||
HashMap<String, String> ogcLinks = layer.getLayer().getOgcLinks();
|
HashMap<String, String> ogcLinks = layer.getLayer().getOgcLinks();
|
||||||
final String wmsLink = ogcLinks.get("wms");
|
final String wmsLink = ogcLinks.get("wms");
|
||||||
final String layerName = URLUtil.getValueOfParameter("layers", wmsLink);
|
this.layerName = URLUtil.getValueOfParameter("layers", wmsLink);
|
||||||
|
|
||||||
GeoportalDataViewerServiceAsync.Util.getInstance().parseWmsRequest(wmsLink, layerName,
|
GeoportalDataViewerServiceAsync.Util.getInstance().parseWmsRequest(wmsLink, layerName,
|
||||||
new AsyncCallback<GeoInformationForWMSRequest>() {
|
new AsyncCallback<GeoInformationForWMSRequest>() {
|
||||||
|
@ -182,9 +192,7 @@ public class LayerCollectionPanel extends Composite {
|
||||||
GWT.log("is isToggle: " + buttonLegend.isToggle());
|
GWT.log("is isToggle: " + buttonLegend.isToggle());
|
||||||
GWT.log("is isToggled: " + buttonLegend.isToggled());
|
GWT.log("is isToggled: " + buttonLegend.isToggled());
|
||||||
if (legendPanel.isVisible()) {
|
if (legendPanel.isVisible()) {
|
||||||
legendPanel.clear();
|
hideStyleLegend();
|
||||||
legendPanel.setVisible(false);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
legendPanel.setVisible(true);
|
legendPanel.setVisible(true);
|
||||||
loadLegend(wmsLink);
|
loadLegend(wmsLink);
|
||||||
|
@ -193,11 +201,45 @@ public class LayerCollectionPanel extends Composite {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
listBoxStyles.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(ChangeEvent event) {
|
||||||
|
setLayerStyle();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setLayerStyle() {
|
||||||
|
UpdateLayerToMapEvent updateLayer = new UpdateLayerToMapEvent(this.gcubeCollection, this.layerName,
|
||||||
|
LAYER_TYPE.INDEX);
|
||||||
|
updateLayer.setOperation(REQUEST_PARAMETER.STYLE, listBoxStyles.getSelectedValue());
|
||||||
|
applicationBus.fireEvent(updateLayer);
|
||||||
|
if (legendPanel.isVisible()) {
|
||||||
|
legendPanel.clear();
|
||||||
|
legendPanel.setVisible(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetLayerStyle() {
|
||||||
|
listBoxStyles.setSelectedIndex(0);
|
||||||
|
listBoxStyles.setSelectedValue(listBoxStyles.getSelectedValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableLayerStyle(boolean enabled) {
|
||||||
|
listBoxStyles.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hideStyleLegend() {
|
||||||
|
legendPanel.clear();
|
||||||
|
legendPanel.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the checkbox.
|
* Gets the checkbox.
|
||||||
*
|
*
|
||||||
|
|
|
@ -8,6 +8,7 @@ public class WFSMakerUtil {
|
||||||
|
|
||||||
public static final String CQL_FILTER_PARAMETER = "CQL_FILTER";
|
public static final String CQL_FILTER_PARAMETER = "CQL_FILTER";
|
||||||
|
|
||||||
|
|
||||||
public static String buildWFSRequest(String webserviceURL, String layerName, int maxFeatures, String propertyName,
|
public static String buildWFSRequest(String webserviceURL, String layerName, int maxFeatures, String propertyName,
|
||||||
String cqlFilter) throws Exception {
|
String cqlFilter) throws Exception {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue