2020-11-19 15:19:27 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
*/
|
2020-10-27 16:04:34 +01:00
|
|
|
package org.gcube.portlets.user.geoportaldataviewer.client;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2021-10-14 11:34:04 +02:00
|
|
|
import java.util.Collection;
|
2020-10-27 16:04:34 +01:00
|
|
|
import java.util.HashMap;
|
2022-11-07 17:58:06 +01:00
|
|
|
import java.util.LinkedHashMap;
|
2020-10-27 16:04:34 +01:00
|
|
|
import java.util.List;
|
2020-10-30 12:19:51 +01:00
|
|
|
import java.util.Map;
|
2022-10-19 17:51:13 +02:00
|
|
|
import java.util.Set;
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
|
2022-10-18 14:17:41 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
|
2022-10-14 15:31:32 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
|
2023-01-12 11:00:09 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
2022-10-19 17:51:13 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
2022-10-24 12:23:52 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
2022-11-16 16:42:12 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
2023-01-12 11:00:09 +01:00
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
|
2021-08-02 15:20:01 +02:00
|
|
|
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
|
2020-10-27 16:04:34 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType;
|
2021-09-01 12:51:06 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
2022-10-18 14:17:41 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
|
2020-11-19 15:19:27 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler;
|
2020-10-29 15:18:14 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEventHandler;
|
2020-11-03 13:09:08 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
|
2022-12-22 11:59:07 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent.EVENT_SOURCE;
|
2020-11-19 15:19:27 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEvent;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMinimumEventHandler;
|
2021-09-06 16:39:12 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
2021-11-12 14:54:54 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
|
2021-10-15 17:51:09 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.ModalWindow;
|
2022-10-25 14:53:56 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil;
|
2020-11-19 15:19:27 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
2020-10-27 16:04:34 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
2020-11-19 15:19:27 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
|
2020-10-29 15:18:14 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
|
2020-10-27 16:04:34 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
|
2020-11-19 15:19:27 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
|
2022-10-13 16:53:33 +02:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObjectType;
|
2020-11-03 13:09:08 +01:00
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis;
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2020-11-03 13:09:08 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.Button;
|
2022-10-20 18:01:54 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.Label;
|
2020-11-03 13:09:08 +01:00
|
|
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
2021-10-15 17:51:09 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
2022-10-20 18:01:54 +02:00
|
|
|
import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
2020-10-27 16:04:34 +01:00
|
|
|
import com.google.gwt.core.client.GWT;
|
2020-11-03 18:04:47 +01:00
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
2022-10-20 18:01:54 +02:00
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
2022-12-22 16:38:43 +01:00
|
|
|
import com.google.gwt.dom.client.Style.Visibility;
|
2020-11-03 13:09:08 +01:00
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
2020-10-29 15:18:14 +01:00
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
2021-09-06 16:39:12 +02:00
|
|
|
import com.google.gwt.json.client.JSONArray;
|
|
|
|
import com.google.gwt.json.client.JSONParser;
|
2020-11-03 18:04:47 +01:00
|
|
|
import com.google.gwt.user.client.DOM;
|
|
|
|
import com.google.gwt.user.client.Element;
|
|
|
|
import com.google.gwt.user.client.Event;
|
|
|
|
import com.google.gwt.user.client.EventListener;
|
2022-10-20 18:01:54 +02:00
|
|
|
import com.google.gwt.user.client.Random;
|
2022-12-22 11:59:07 +01:00
|
|
|
import com.google.gwt.user.client.Timer;
|
2020-10-27 16:04:34 +01:00
|
|
|
import com.google.gwt.user.client.Window;
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
2020-10-30 12:19:51 +01:00
|
|
|
import com.google.gwt.user.client.ui.FlexTable;
|
2021-09-09 15:55:33 +02:00
|
|
|
import com.google.gwt.user.client.ui.FlowPanel;
|
2020-10-30 12:19:51 +01:00
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
2022-11-15 10:08:02 +01:00
|
|
|
import com.google.gwt.user.client.ui.RootPanel;
|
2021-09-07 17:29:56 +02:00
|
|
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
2020-11-03 18:04:47 +01:00
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2020-10-29 17:08:29 +01:00
|
|
|
import ol.Coordinate;
|
2021-09-06 16:39:12 +02:00
|
|
|
import ol.Extent;
|
|
|
|
import ol.OLFactory;
|
|
|
|
import ol.format.GeoJson;
|
|
|
|
import ol.geom.Geometry;
|
2020-10-29 17:08:29 +01:00
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/**
|
|
|
|
* The Class LayerManager.
|
|
|
|
*
|
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
|
|
|
*
|
2021-07-30 14:57:08 +02:00
|
|
|
* Oct 27, 2020
|
2020-10-27 16:04:34 +01:00
|
|
|
*/
|
|
|
|
public class LayerManager {
|
2020-12-04 15:06:32 +01:00
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/** The ol map. */
|
2021-11-12 14:54:54 +01:00
|
|
|
private OpenLayerMap olMap;
|
2020-11-19 15:19:27 +01:00
|
|
|
|
2022-10-19 17:51:13 +02:00
|
|
|
private Map<String, LayerObject> mapOtherLayerObjects = new HashMap<String, LayerObject>();
|
2022-10-17 16:52:22 +02:00
|
|
|
private Map<String, LayerObject> mapIndexLayerObjects = new HashMap<String, LayerObject>();
|
2020-11-19 15:19:27 +01:00
|
|
|
private HandlerManager layerManagerBus = new HandlerManager("");
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2020-11-03 13:09:08 +01:00
|
|
|
private HandlerManager applicationBus;
|
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
private OverlayLayerManager overlayLayerManager;
|
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/**
|
|
|
|
* Instantiates a new layer manager.
|
2020-11-19 15:19:27 +01:00
|
|
|
*
|
|
|
|
* @param applicationBus the application bus
|
2020-10-27 16:04:34 +01:00
|
|
|
*/
|
2020-11-03 13:09:08 +01:00
|
|
|
public LayerManager(HandlerManager applicationBus) {
|
|
|
|
this.applicationBus = applicationBus;
|
2021-10-14 11:34:04 +02:00
|
|
|
overlayLayerManager = new OverlayLayerManager(applicationBus);
|
2020-10-29 15:18:14 +01:00
|
|
|
bindEvents();
|
2020-10-27 16:04:34 +01:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
/**
|
|
|
|
* Bind events.
|
|
|
|
*/
|
2020-10-29 15:18:14 +01:00
|
|
|
private void bindEvents() {
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
layerManagerBus.addHandler(QueryDataEvent.TYPE, new QueryDataEventHandler() {
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-10-29 15:18:14 +01:00
|
|
|
@Override
|
2020-10-30 12:19:51 +01:00
|
|
|
public void onQueryInteraction(final QueryDataEvent queryEvent) {
|
2021-07-30 14:57:08 +02:00
|
|
|
// GeoportalDataViewerConstants.print("fired QueryDataEvent:
|
|
|
|
// "+queryEvent.toString());
|
|
|
|
|
|
|
|
if (queryEvent.getGeoQuery() != null) {
|
2020-10-29 15:18:14 +01:00
|
|
|
GeoQuery selectDataInfo = queryEvent.getGeoQuery();
|
2022-10-19 17:51:13 +02:00
|
|
|
final String productID = queryEvent.getProductID();
|
2021-07-30 14:57:08 +02:00
|
|
|
|
|
|
|
GWT.log("(" + selectDataInfo.getX1() + "," + selectDataInfo.getY1() + ")(" + selectDataInfo.getX2()
|
|
|
|
+ "," + selectDataInfo.getY2() + ")");
|
|
|
|
|
2020-10-29 15:18:14 +01:00
|
|
|
BoundsMap mapBBOX = new BoundsMap();
|
2020-10-29 17:48:20 +01:00
|
|
|
double minX = queryEvent.getGeoQuery().getX1();
|
|
|
|
double minY = queryEvent.getGeoQuery().getY1();
|
2020-10-29 17:08:29 +01:00
|
|
|
Coordinate centerCoordinate = new Coordinate(minX, minY);
|
2021-09-01 12:51:06 +02:00
|
|
|
centerCoordinate = olMap.transform(centerCoordinate, MAP_PROJECTION.EPSG_3857.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_4326.getName());
|
2020-10-29 17:08:29 +01:00
|
|
|
mapBBOX.setLowerLeftX(centerCoordinate.getX());
|
|
|
|
mapBBOX.setLowerLeftY(centerCoordinate.getY());
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-10-29 17:48:20 +01:00
|
|
|
// double maxX = olMap.getExtent().getUpperRightX();
|
|
|
|
// double maxY = olMap.getExtent().getUpperRightY();
|
|
|
|
double maxX = queryEvent.getGeoQuery().getX2();
|
|
|
|
double maxY = queryEvent.getGeoQuery().getY2();
|
2021-07-30 14:57:08 +02:00
|
|
|
centerCoordinate = new Coordinate(maxX, maxY);
|
2021-09-01 12:51:06 +02:00
|
|
|
centerCoordinate = olMap.transform(centerCoordinate, MAP_PROJECTION.EPSG_3857.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_4326.getName());
|
2020-10-29 17:08:29 +01:00
|
|
|
mapBBOX.setUpperRightX(centerCoordinate.getX());
|
|
|
|
mapBBOX.setUpperRightY(centerCoordinate.getY());
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2021-09-01 12:51:06 +02:00
|
|
|
mapBBOX.setCrs(MAP_PROJECTION.EPSG_4326.getName());
|
2021-07-30 14:57:08 +02:00
|
|
|
|
|
|
|
GWT.log("Bounds is: " + mapBBOX);
|
2022-12-15 15:39:08 +01:00
|
|
|
GWT.log("Bounds to" + MAP_PROJECTION.EPSG_4326.getName() + " Long/Lat: " + mapBBOX.getLowerLeftY()
|
|
|
|
+ "," + mapBBOX.getLowerLeftX() + "," + mapBBOX.getUpperRightY() + ","
|
|
|
|
+ mapBBOX.getUpperRightX());
|
2021-07-30 14:57:08 +02:00
|
|
|
GWT.log("MAX_WFS_FEATURES is: " + GeoportalDataViewerConstants.MAX_WFS_FEATURES);
|
|
|
|
// GeoportalDataViewerConstants.print("calling getDataResult");
|
2021-09-07 17:29:56 +02:00
|
|
|
|
2021-09-08 14:40:36 +02:00
|
|
|
List<LayerObject> listLO = new ArrayList<LayerObject>();
|
2021-09-09 15:55:33 +02:00
|
|
|
// for querying base layers
|
2022-10-19 17:51:13 +02:00
|
|
|
listLO.addAll(mapIndexLayerObjects.values());
|
2021-09-09 15:55:33 +02:00
|
|
|
|
|
|
|
// for querying detail layers only in this case
|
|
|
|
if (olMap.getCurrentResolution() < OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) {
|
2022-10-19 17:51:13 +02:00
|
|
|
Collection<LayerObject> collLO = mapOtherLayerObjects.values();
|
2021-10-14 11:34:04 +02:00
|
|
|
listLO.addAll(collLO);
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
ArrayList<LayerObject> layerVisibility = new ArrayList<LayerObject>(collLO.size());
|
|
|
|
layerVisibility.addAll(collLO);
|
2022-09-06 14:53:19 +02:00
|
|
|
// Managing layer visibility. If a layer is not visible has to be not queryable
|
2021-10-14 11:34:04 +02:00
|
|
|
for (LayerObject layerObject : layerVisibility) {
|
|
|
|
String layerName = layerObject.getLayerItem().getName();
|
|
|
|
boolean isLayerVisible = olMap.isLayerVisible(layerName);
|
2022-09-06 14:53:19 +02:00
|
|
|
if (!isLayerVisible) {
|
|
|
|
GWT.log("From querying removing layername: " + layerName + ", it is not visible");
|
2021-10-14 11:34:04 +02:00
|
|
|
listLO.remove(layerObject);
|
|
|
|
}
|
|
|
|
}
|
2021-09-08 14:40:36 +02:00
|
|
|
}
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2021-08-31 18:21:17 +02:00
|
|
|
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(listLO, olMap.getProjectionCode(),
|
|
|
|
mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(),
|
|
|
|
new AsyncCallback<List<GeoNaSpatialQueryResult>>() {
|
2021-07-30 14:57:08 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
// GeoportalDataViewerConstants.print("on Failure DataResult:
|
|
|
|
// "+caught.getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
|
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
if (listGeonaDataObjects == null)
|
|
|
|
return;
|
|
|
|
|
2021-08-02 16:45:05 +02:00
|
|
|
GWT.log("GeoNaDataObject's is/are " + listGeonaDataObjects.size());
|
2022-10-18 14:17:41 +02:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
MapEventType sourceEvent = queryEvent.getSourceMapEventType();
|
|
|
|
GWT.log("sourceEvent is: " + sourceEvent);
|
|
|
|
if (sourceEvent.equals(MapEventType.ADDED_CENTROID_LAYER_TO_MAP)
|
|
|
|
&& (listGeonaDataObjects.size() == 0)) {
|
|
|
|
// here the centroid is not available
|
|
|
|
// GeoportalDataViewer.showPopover(RootPanel.get(GeoportalDataViewer.APP_NOTIFIER),
|
|
|
|
// "No centroid available for the selected project",
|
|
|
|
// "Project without a centroid");
|
|
|
|
olMap.setCenter(queryEvent.getQueryClickExtent().getCenter());
|
2021-07-30 14:57:08 +02:00
|
|
|
return;
|
2022-12-22 11:59:07 +01:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2022-09-06 14:53:19 +02:00
|
|
|
List<FeatureRow> theFeatures = null;
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
// TODO SWTCH FOR EARCH ITEM TYPE
|
2022-10-25 11:35:03 +02:00
|
|
|
for (final GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
|
2022-09-06 14:53:19 +02:00
|
|
|
GWT.log("GeoNaDataObject: " + geoNaDataObject);
|
2021-07-30 14:57:08 +02:00
|
|
|
List<FeatureRow> features = geoNaDataObject.getFeatures();
|
2022-09-06 14:53:19 +02:00
|
|
|
LayerItem layerItem = geoNaDataObject.getSourceLayerObject().getLayerItem();
|
|
|
|
GWT.log(" features: " + features);
|
|
|
|
GWT.log(" layerItem: " + layerItem);
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2022-09-06 14:53:19 +02:00
|
|
|
GWT.log("GeoNaDataObject Source layer item name: " + layerItem.getName());
|
2021-09-07 17:29:56 +02:00
|
|
|
|
2022-09-06 14:53:19 +02:00
|
|
|
HashMap<String, List<FeatureRow>> listUniqueProducts = new HashMap<String, List<FeatureRow>>();
|
|
|
|
// Clustering features for productId
|
2021-07-30 14:57:08 +02:00
|
|
|
if (features != null && features.size() > 0) {
|
2021-07-30 15:57:25 +02:00
|
|
|
String theProductId = null;
|
2022-09-06 14:53:19 +02:00
|
|
|
for (FeatureRow fRow : features) {
|
2022-10-19 17:51:13 +02:00
|
|
|
List<String> productIdLst = fRow.getMapProperties().get("projectid");
|
2022-09-06 14:53:19 +02:00
|
|
|
if (productIdLst != null) {
|
2021-07-30 15:57:25 +02:00
|
|
|
theProductId = productIdLst.get(0);
|
2022-09-06 14:53:19 +02:00
|
|
|
if (theProductId != null) {
|
|
|
|
List<FeatureRow> listFeatures = listUniqueProducts
|
|
|
|
.get(theProductId);
|
|
|
|
if (listFeatures == null) {
|
|
|
|
listFeatures = new ArrayList<FeatureRow>();
|
2021-07-30 14:57:08 +02:00
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
|
|
|
|
listFeatures.add(fRow);
|
|
|
|
listUniqueProducts.put(theProductId, listFeatures);
|
2021-07-30 14:57:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-06 14:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
GWT.log("listUniqueProducts keyset: " + listUniqueProducts.keySet());
|
|
|
|
|
|
|
|
// USING ONLY THE FIRST FEATURE IN THE LIST
|
|
|
|
if (features != null && features.size() > 0) {
|
|
|
|
|
|
|
|
// I need to show exactly the feature with produc_id == recordId
|
2022-10-19 17:51:13 +02:00
|
|
|
if (productID != null) {
|
|
|
|
GWT.log("productID is not null: " + productID);
|
2022-09-06 14:53:19 +02:00
|
|
|
// Searching mongoItemId in the list of product
|
2022-10-19 17:51:13 +02:00
|
|
|
theFeatures = listUniqueProducts.get(productID);
|
|
|
|
GWT.log("Loaded productid == product_id with id: " + productID
|
2022-09-06 14:53:19 +02:00
|
|
|
+ ", the features are: " + theFeatures);
|
|
|
|
|
|
|
|
// the recordId/mongoItemId to show has been passed but not found into
|
|
|
|
// list of
|
|
|
|
// FeatureRow
|
|
|
|
if (theFeatures == null || theFeatures.isEmpty()) {
|
2023-01-10 14:36:37 +01:00
|
|
|
// means that another version of the project has been passed without
|
|
|
|
// features
|
|
|
|
// stored into centroid layers.
|
|
|
|
// so centering the map on the centroid passed into query and stored
|
|
|
|
// into project metadata
|
|
|
|
olMap.setCenter(queryEvent.getQueryClickExtent().getCenter());
|
2022-09-06 14:53:19 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If mongoItemId not passed
|
2022-10-19 17:51:13 +02:00
|
|
|
if (productID == null) {
|
|
|
|
GWT.log("productID is null");
|
2022-09-06 14:53:19 +02:00
|
|
|
// Checking if the features returned belonging to detail layers (not
|
|
|
|
// centroids).
|
|
|
|
if (listUniqueProducts.isEmpty()) {
|
2021-09-07 17:29:56 +02:00
|
|
|
// in this case the feature/s returned is/are a (detail) layer/s
|
|
|
|
// belonging
|
2021-08-31 18:21:17 +02:00
|
|
|
// to a record/concessione (not centroid layer),
|
2021-09-07 17:29:56 +02:00
|
|
|
// so calling show popuup info on detail layers if the
|
|
|
|
// following events are true.
|
2021-09-09 15:55:33 +02:00
|
|
|
if (sourceEvent.equals(MapEventType.MOUSE_CLICK) && olMap
|
|
|
|
.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
|
|
|
|
|
|
|
|
// Here I need to pass only the visible layers
|
2021-09-07 17:29:56 +02:00
|
|
|
showPopupInfoForLayer(listGeonaDataObjects,
|
2021-09-08 14:40:36 +02:00
|
|
|
queryEvent.getQueryClickExtent());
|
2021-09-07 17:29:56 +02:00
|
|
|
}
|
2021-08-31 18:21:17 +02:00
|
|
|
return;
|
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// The features of the first centroid layer selected
|
|
|
|
if (theFeatures == null || theFeatures.size() == 0) {
|
|
|
|
for (String theProductId : listUniqueProducts.keySet()) {
|
|
|
|
|
|
|
|
theFeatures = listUniqueProducts.get(theProductId);
|
|
|
|
|
|
|
|
if (theFeatures.size() > 0)
|
|
|
|
break;
|
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
}
|
|
|
|
}
|
2021-07-30 15:57:25 +02:00
|
|
|
|
2022-09-06 14:53:19 +02:00
|
|
|
// Displaying popup info for centroid layer passing the first feature
|
2021-09-09 15:55:33 +02:00
|
|
|
if (sourceEvent.equals(MapEventType.MOUSE_CLICK)
|
|
|
|
|| sourceEvent.equals(MapEventType.ADDED_CENTROID_LAYER_TO_MAP)) {
|
2022-09-06 14:53:19 +02:00
|
|
|
GWT.log("Source event is: " + MapEventType.MOUSE_CLICK + ", or "
|
|
|
|
+ MapEventType.ADDED_CENTROID_LAYER_TO_MAP);
|
|
|
|
|
|
|
|
// Displaying popup info for centroid layer passing the first feature
|
|
|
|
showPopupInfoForCentroidLayer(geoNaDataObject, theFeatures.get(0),
|
2021-09-08 14:40:36 +02:00
|
|
|
queryEvent.getQueryClickExtent().getCenter());
|
|
|
|
}
|
2021-07-30 15:57:25 +02:00
|
|
|
|
2021-08-31 18:21:17 +02:00
|
|
|
if (olMap.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
|
2022-09-06 14:53:19 +02:00
|
|
|
GWT.log("Current zoom level is less than QUERY_MIN_ZOOM_LEVEL, Loading all layers of any product");
|
2022-10-18 14:17:41 +02:00
|
|
|
for (final String theProductID : listUniqueProducts.keySet()) {
|
|
|
|
GWT.log("Loading layers of theProductId: " + theProductID);
|
2022-09-06 14:53:19 +02:00
|
|
|
// retrieving and showing WMS layers of a concessione if the ZOOM
|
|
|
|
// level
|
|
|
|
// is >
|
|
|
|
// QUERY_MIN_ZOOM_LEVEL
|
2022-11-16 16:42:12 +01:00
|
|
|
final String theProfileID = geoNaDataObject.getSourceLayerObject()
|
|
|
|
.getProfileID();
|
|
|
|
addLayerToMapForProject(theProfileID, theProductID,
|
|
|
|
geoNaDataObject.getSourceLayerObject().getProjectDV(),
|
|
|
|
false);
|
2022-09-06 14:53:19 +02:00
|
|
|
}
|
2021-08-31 18:21:17 +02:00
|
|
|
} else {
|
2021-09-02 12:54:39 +02:00
|
|
|
// removing all WMS detail layers if the ZOOM level is <
|
|
|
|
// QUERY_MIN_ZOOM_LEVEL
|
2021-09-08 14:40:36 +02:00
|
|
|
removeAllDetailLayers();
|
2021-08-31 18:21:17 +02:00
|
|
|
}
|
2020-11-25 18:44:09 +01:00
|
|
|
}
|
2020-11-24 12:58:13 +01:00
|
|
|
}
|
2022-10-18 14:17:41 +02:00
|
|
|
|
2020-11-24 12:58:13 +01:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
});
|
2020-10-29 15:18:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
layerManagerBus.addHandler(AddedLayerToMapEvent.TYPE, new AddedLayerToMapEventHandler() {
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
@Override
|
|
|
|
public void onLayerRendered(AddedLayerToMapEvent addedLayerToMapEvent) {
|
2021-07-30 14:57:08 +02:00
|
|
|
GWT.log("Fired into layerManagerBus " + addedLayerToMapEvent);
|
2020-11-19 15:19:27 +01:00
|
|
|
applicationBus.fireEvent(addedLayerToMapEvent);
|
|
|
|
}
|
|
|
|
});
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
layerManagerBus.addHandler(ZoomOutOverMinimumEvent.TYPE, new ZoomOutOverMinimumEventHandler() {
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
@Override
|
|
|
|
public void onZoomOut(ZoomOutOverMinimumEvent zoomOutEvent) {
|
2021-07-30 14:57:08 +02:00
|
|
|
GWT.log("Fired into layerManagerBus " + zoomOutEvent);
|
2021-09-08 14:40:36 +02:00
|
|
|
removeAllDetailLayers();
|
2020-11-19 15:19:27 +01:00
|
|
|
applicationBus.fireEvent(zoomOutEvent);
|
|
|
|
}
|
|
|
|
});
|
2020-10-29 15:18:14 +01:00
|
|
|
}
|
2022-11-16 16:42:12 +01:00
|
|
|
|
2022-11-15 10:08:02 +01:00
|
|
|
/**
|
|
|
|
* Adds the layer to map for project.
|
|
|
|
*
|
2022-11-16 16:42:12 +01:00
|
|
|
* @param theProfileID the the profile ID
|
|
|
|
* @param theProductID the the product ID
|
|
|
|
* @param theProjectDV the the project DV
|
2022-11-15 10:08:02 +01:00
|
|
|
* @param notifyLayerAlreadyAdded the notify layer already added
|
|
|
|
*/
|
2022-11-16 16:42:12 +01:00
|
|
|
public void addLayerToMapForProject(String theProfileID, String theProductID, ProjectDV theProjectDV,
|
|
|
|
final boolean notifyLayerAlreadyAdded) {
|
|
|
|
|
|
|
|
GeoportalDataViewerServiceAsync.Util.getInstance().getLayersForId(theProfileID, theProductID,
|
2022-11-09 11:42:44 +01:00
|
|
|
new AsyncCallback<List<GCubeSDIViewerLayerDV>>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-11-16 16:42:12 +01:00
|
|
|
public void onSuccess(List<GCubeSDIViewerLayerDV> result) {
|
2022-11-09 11:42:44 +01:00
|
|
|
|
|
|
|
for (GCubeSDIViewerLayerDV layer : result) {
|
2022-11-16 16:42:12 +01:00
|
|
|
GWT.log("Adding layer: " + layer.getLayerName());
|
|
|
|
addLayer(LayerObjectType.PROJECT_LAYER, layer.getLayerName(), layer.getLayerName(),
|
|
|
|
layer.getWMSLink(), false, false, null, true,
|
|
|
|
OLMapManager.LAYER_DETAIL_MIN_RESOLUTION, OLMapManager.LAYER_DETAIL_MAX_RESOLUTION,
|
|
|
|
theProfileID, theProductID, theProjectDV, notifyLayerAlreadyAdded);
|
2022-11-09 11:42:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
2022-11-16 16:42:12 +01:00
|
|
|
|
2022-11-09 11:42:44 +01:00
|
|
|
}
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
/**
|
|
|
|
* Removes the all detail layers.
|
|
|
|
*/
|
2021-09-08 14:40:36 +02:00
|
|
|
public void removeAllDetailLayers() {
|
2022-10-19 17:51:13 +02:00
|
|
|
mapOtherLayerObjects.clear();
|
2021-09-08 14:40:36 +02:00
|
|
|
olMap.removeAllDetailLayers();
|
2023-01-31 15:24:45 +01:00
|
|
|
olMap.removeAllLayerFeaturesAsHighlight();
|
2021-10-14 11:34:04 +02:00
|
|
|
overlayLayerManager.resetLayers();
|
2021-09-08 14:40:36 +02:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/**
|
2020-11-19 15:19:27 +01:00
|
|
|
* Parses the geona references.
|
2020-10-27 16:04:34 +01:00
|
|
|
*
|
2022-10-13 16:53:33 +02:00
|
|
|
* @param layerObject the layer object
|
2022-10-18 14:17:41 +02:00
|
|
|
* @param fRow the f row
|
2020-11-19 15:19:27 +01:00
|
|
|
* @return the show details event
|
2020-10-27 16:04:34 +01:00
|
|
|
*/
|
2022-10-13 16:53:33 +02:00
|
|
|
private ShowDetailsEvent parseGeonaReferences(LayerObject layerObject, FeatureRow fRow) {
|
2021-07-30 14:57:08 +02:00
|
|
|
if (fRow == null)
|
2020-11-19 15:19:27 +01:00
|
|
|
return null;
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2022-10-19 17:51:13 +02:00
|
|
|
List<String> productIds = fRow.getMapProperties().get("projectid");
|
2021-07-30 14:57:08 +02:00
|
|
|
if (productIds != null && productIds.size() > 0) {
|
|
|
|
String productId = productIds.get(0);
|
2022-10-13 16:53:33 +02:00
|
|
|
LayerObjectType layerObjectType = layerObject.getType();
|
2022-10-19 17:51:13 +02:00
|
|
|
return new ShowDetailsEvent(layerObjectType != null ? layerObjectType.name() : null,
|
2022-12-22 11:59:07 +01:00
|
|
|
layerObject.getProfileID(), productId, fRow, true, EVENT_SOURCE.OPEN_DETAILS);
|
2020-11-19 15:19:27 +01:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
return null;
|
|
|
|
}
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2022-10-13 16:53:33 +02:00
|
|
|
// ******************************** LAYERS Management
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the layer.
|
|
|
|
*
|
|
|
|
* @param object the object
|
|
|
|
*/
|
|
|
|
public void addLayer(LayerObject object) {
|
|
|
|
GWT.log("Layers management : Add layer " + object);
|
|
|
|
|
|
|
|
switch (object.getType()) {
|
|
|
|
case GENERIC_LAYER: {
|
|
|
|
GWT.log("SUPPORT TO EXTERNAL LAYERS TO BE IMPLEMENTED");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case PROJECT_LAYER: {
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case INDEX_LAYER: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/**
|
2020-11-19 15:19:27 +01:00
|
|
|
* Adds the layer.
|
2020-10-27 16:04:34 +01:00
|
|
|
*
|
2023-01-12 11:00:09 +01:00
|
|
|
* @param lot the lot
|
|
|
|
* @param layerTitle the layer title
|
|
|
|
* @param layerName the layer name
|
|
|
|
* @param wmsLink the wms link
|
|
|
|
* @param isBase the is base
|
|
|
|
* @param displayInLayerSwitcher the display in layer switcher
|
|
|
|
* @param UUID the uuid
|
|
|
|
* @param asDetailLayer the as detail layer
|
|
|
|
* @param minResolution the min resolution
|
|
|
|
* @param maxResolution the max resolution
|
|
|
|
* @param profileID the profile ID
|
|
|
|
* @param projectID the project ID
|
|
|
|
* @param projectDV the project DV
|
|
|
|
* @param notifyLayerAlreadyAdded the notify layer already added
|
2020-10-27 16:04:34 +01:00
|
|
|
*/
|
2022-11-09 11:42:44 +01:00
|
|
|
private void addLayer(final LayerObjectType lot, final String layerTitle, final String layerName,
|
2021-07-30 14:57:08 +02:00
|
|
|
final String wmsLink, final boolean isBase, final boolean displayInLayerSwitcher, final String UUID,
|
2022-10-19 17:51:13 +02:00
|
|
|
final boolean asDetailLayer, Double minResolution, Double maxResolution, final String profileID,
|
2022-11-15 10:08:02 +01:00
|
|
|
final String projectID, final ProjectDV projectDV, final boolean notifyLayerAlreadyAdded) {
|
2022-10-25 17:01:24 +02:00
|
|
|
GWT.log("addLayer called for profileID: " + profileID + ", projectID: " + projectID + ", projectDV: "
|
|
|
|
+ projectDV);
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
final LayerType featureType = isBase ? LayerType.RASTER_BASELAYER : LayerType.FEATURE_TYPE;
|
2021-09-02 12:54:39 +02:00
|
|
|
|
|
|
|
if (wmsLink == null || wmsLink.isEmpty()) {
|
2021-08-31 18:21:17 +02:00
|
|
|
GeoportalDataViewerConstants.printJs("Skipping add layer for wmsLink as null or empty");
|
|
|
|
return;
|
|
|
|
}
|
2021-09-02 12:54:39 +02:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
GeoportalDataViewerServiceAsync.Util.getInstance().parseWmsRequest(wmsLink, layerName,
|
|
|
|
new AsyncCallback<GeoInformationForWMSRequest>() {
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
@Override
|
|
|
|
public void onFailure(Throwable caught) {
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
Window.alert(caught.getMessage());
|
|
|
|
}
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
@Override
|
|
|
|
public void onSuccess(GeoInformationForWMSRequest geoInfoWMS) {
|
|
|
|
|
|
|
|
GWT.log("Parsed WMS Request returned: " + geoInfoWMS);
|
2022-11-16 16:42:12 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
LayerItem layerItem = toLayerItem(featureType, layerTitle, geoInfoWMS.getLayerName(),
|
|
|
|
geoInfoWMS.getWmsRequest(), geoInfoWMS.getBaseWmsServiceHost(), true, isBase,
|
|
|
|
displayInLayerSwitcher, (ArrayList<String>) geoInfoWMS.getStyles().getGeoStyles(),
|
|
|
|
geoInfoWMS.getWmsRequest(), false, geoInfoWMS.getMapWMSNoStandard(),
|
2021-09-02 12:54:39 +02:00
|
|
|
geoInfoWMS.isNcWMS(), UUID, geoInfoWMS.getZAxis(), minResolution, maxResolution);
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
LayerObject lo = new LayerObject();
|
|
|
|
lo.setLayerItem(layerItem);
|
2022-10-13 16:53:33 +02:00
|
|
|
lo.setType(lot);
|
2022-10-19 17:51:13 +02:00
|
|
|
lo.setProjectID(projectID);
|
|
|
|
lo.setProfileID(profileID);
|
2022-10-25 11:35:03 +02:00
|
|
|
lo.setProjectDV(projectDV);
|
2022-12-22 11:59:07 +01:00
|
|
|
|
|
|
|
GWT.log("LayerObject ID is: " + lo.getProjectID());
|
|
|
|
if (lo.getProjectDV() != null)
|
|
|
|
GWT.log("LayerObject into ProjectDV is: " + lo.getProjectDV().getId());
|
2022-10-18 17:32:12 +02:00
|
|
|
|
2022-10-19 17:51:13 +02:00
|
|
|
String layerNameKey = layerItem.getName();
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2022-10-19 17:51:13 +02:00
|
|
|
LayerObject theLo;
|
|
|
|
switch (lo.getType()) {
|
|
|
|
case INDEX_LAYER:
|
|
|
|
theLo = mapIndexLayerObjects.get(layerNameKey);
|
|
|
|
if (theLo == null) {
|
|
|
|
theLo = lo;
|
|
|
|
mapIndexLayerObjects.put(layerNameKey, theLo);
|
2022-10-25 17:01:24 +02:00
|
|
|
GWT.log("INDEX_LAYER mapIndexLayerObjects is: " + mapIndexLayerObjects);
|
2021-08-31 18:21:17 +02:00
|
|
|
olMap.addWMSLayer(layerItem);
|
2021-09-09 15:55:33 +02:00
|
|
|
} else {
|
2022-10-19 17:51:13 +02:00
|
|
|
GWT.log("Skipping " + lo.getType() + " layer " + theLo.getLayerItem().getName()
|
|
|
|
+ " already added to Map");
|
2021-09-08 14:40:36 +02:00
|
|
|
}
|
2022-10-19 17:51:13 +02:00
|
|
|
break;
|
|
|
|
case PROJECT_LAYER:
|
|
|
|
theLo = mapOtherLayerObjects.get(layerNameKey);
|
|
|
|
if (theLo == null) {
|
|
|
|
theLo = lo;
|
|
|
|
mapOtherLayerObjects.put(layerNameKey, theLo);
|
2022-10-25 17:01:24 +02:00
|
|
|
GWT.log("PROJECT_LAYER mapOtherLayerObjects is: " + mapOtherLayerObjects);
|
2021-08-31 18:21:17 +02:00
|
|
|
olMap.addWMSDetailLayer(layerItem);
|
2022-10-25 11:35:03 +02:00
|
|
|
overlayLayerManager.addLayerItem(theLo);
|
2022-10-19 17:51:13 +02:00
|
|
|
} else {
|
|
|
|
GWT.log("Skipping " + lo.getType() + " layer " + theLo.getLayerItem().getName()
|
|
|
|
+ " already added to Map");
|
2022-11-16 16:42:12 +01:00
|
|
|
if (notifyLayerAlreadyAdded) {
|
2022-11-15 10:08:02 +01:00
|
|
|
GeoportalDataViewer.showPopover(RootPanel.get(GeoportalDataViewer.APP_NOTIFIER),
|
2022-11-16 16:42:12 +01:00
|
|
|
"Layers from the selected project are already displayed",
|
|
|
|
"Layers displayed");
|
2022-11-15 10:08:02 +01:00
|
|
|
}
|
2022-11-16 16:42:12 +01:00
|
|
|
|
2021-09-08 14:40:36 +02:00
|
|
|
}
|
2022-10-19 17:51:13 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2021-09-02 12:54:39 +02:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
}
|
|
|
|
});
|
2020-10-27 16:04:34 +01:00
|
|
|
}
|
2022-12-22 11:59:07 +01:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
/**
|
|
|
|
* Sets the CQL for layer to index layer.
|
|
|
|
*
|
|
|
|
* @param layerName the layer name
|
|
|
|
* @param cqlFilter the cql filter
|
|
|
|
*/
|
2022-11-28 15:20:21 +01:00
|
|
|
public void setCQLForLayerToIndexLayer(String layerName, String cqlFilter) {
|
|
|
|
LayerObject theLo = mapIndexLayerObjects.get(layerName);
|
2022-12-22 11:59:07 +01:00
|
|
|
if (theLo != null) {
|
|
|
|
boolean isCQLFilter = cqlFilter != null;
|
2022-11-28 15:20:21 +01:00
|
|
|
theLo.getLayerItem().setCqlFilter(cqlFilter);
|
|
|
|
theLo.getLayerItem().setCqlFilterAvailable(isCQLFilter);
|
2022-12-22 11:59:07 +01:00
|
|
|
|
2022-11-28 15:20:21 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-19 15:19:27 +01:00
|
|
|
|
2022-10-13 16:53:33 +02:00
|
|
|
/**
|
|
|
|
* Adds the index layer.
|
|
|
|
*
|
2022-10-25 17:01:24 +02:00
|
|
|
* @param layer the layer
|
2022-10-25 11:35:03 +02:00
|
|
|
* @param profileID the profile ID
|
2022-10-13 16:53:33 +02:00
|
|
|
*/
|
2022-10-27 17:40:04 +02:00
|
|
|
public void addIndexLayer(IndexLayerDV layer, String profileID) {
|
2022-10-19 17:51:13 +02:00
|
|
|
GWT.log("Adding index layer: " + layer);
|
|
|
|
String wmsLink = layer.getLayer().getOgcLinks().get("wms");
|
|
|
|
GWT.log("index layer wmsLink: " + wmsLink);
|
|
|
|
addLayer(LayerObjectType.INDEX_LAYER, null, null, wmsLink, false, false, null, false, null, null, profileID,
|
2022-11-15 10:08:02 +01:00
|
|
|
null, null, false);
|
2022-10-18 14:17:41 +02:00
|
|
|
|
2022-10-13 16:53:33 +02:00
|
|
|
}
|
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
/**
|
|
|
|
* Removes the index layer.
|
|
|
|
*
|
|
|
|
* @param layer the layer
|
|
|
|
*/
|
2022-10-27 17:40:04 +02:00
|
|
|
public void removeIndexLayer(IndexLayerDV layer) {
|
2022-11-07 17:58:06 +01:00
|
|
|
|
2022-10-27 17:40:04 +02:00
|
|
|
String wmsLink = layer.getLayer().getOgcLinks().get("wms");
|
|
|
|
GWT.log("index layer wmsLink: " + wmsLink);
|
2022-11-07 17:58:06 +01:00
|
|
|
|
2022-10-27 17:40:04 +02:00
|
|
|
String layerNameKey = URLUtil.getValueOfParameter("layers", wmsLink);
|
|
|
|
olMap.removeWMSLayer(layerNameKey);
|
|
|
|
mapIndexLayerObjects.remove(layerNameKey);
|
|
|
|
GWT.log("New INDEX_LAYER mapIndexLayerObjects is: " + mapIndexLayerObjects);
|
2022-11-07 17:58:06 +01:00
|
|
|
|
2022-10-27 17:40:04 +02:00
|
|
|
}
|
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
/**
|
2020-11-19 15:19:27 +01:00
|
|
|
* To layer item.
|
2020-10-27 16:04:34 +01:00
|
|
|
*
|
2021-07-30 14:57:08 +02:00
|
|
|
* @param layerType the layer type
|
|
|
|
* @param layerTitle the layer title
|
|
|
|
* @param layerName the layer name
|
|
|
|
* @param layerURL the layer URL
|
|
|
|
* @param mapServerHost the map server host
|
|
|
|
* @param isExternal the is external
|
|
|
|
* @param isBase the is base
|
2020-10-27 16:04:34 +01:00
|
|
|
* @param displayInLayerSwitcher the display in layer switcher
|
2021-07-30 14:57:08 +02:00
|
|
|
* @param styles the styles
|
|
|
|
* @param wmsLink the wms link
|
|
|
|
* @param onTop the on top
|
|
|
|
* @param wmsNotStandardParams the wms not standard params
|
|
|
|
* @param isNcWms the is nc wms
|
|
|
|
* @param UUID the uuid
|
|
|
|
* @param zAxis the z axis
|
2021-09-06 16:39:12 +02:00
|
|
|
* @param minResolution the min resolution
|
|
|
|
* @param maxResolution the max resolution
|
2020-11-19 15:19:27 +01:00
|
|
|
* @return the layer item
|
2020-10-27 16:04:34 +01:00
|
|
|
*/
|
2021-07-30 14:57:08 +02:00
|
|
|
private LayerItem toLayerItem(LayerType layerType, String layerTitle, String layerName, String layerURL,
|
|
|
|
String mapServerHost, boolean isExternal, boolean isBase, boolean displayInLayerSwitcher,
|
|
|
|
ArrayList<String> styles, String wmsLink, boolean onTop, HashMap<String, String> wmsNotStandardParams,
|
2021-09-02 12:54:39 +02:00
|
|
|
boolean isNcWms, String UUID, ZAxis zAxis, Double minResolution, Double maxResolution) {
|
2020-10-27 16:04:34 +01:00
|
|
|
|
|
|
|
// GWT.log("Add addLayerByWms 1");
|
2020-10-29 15:18:14 +01:00
|
|
|
LayerItem layerItem = new LayerItem();
|
|
|
|
layerItem.setBaseLayer(isBase);
|
|
|
|
layerItem.setTitle(layerTitle);
|
|
|
|
layerItem.setName(layerName);
|
|
|
|
layerItem.setUrl(layerURL);
|
|
|
|
layerItem.setMapServerHost(mapServerHost);
|
2021-07-30 14:57:08 +02:00
|
|
|
// l.setExternal(isExternal);
|
2020-10-29 15:18:14 +01:00
|
|
|
layerItem.setOpacity(1d);
|
|
|
|
layerItem.setBuffer(2);
|
2020-11-19 15:19:27 +01:00
|
|
|
layerItem.setWmsLink(wmsLink);
|
2020-10-29 15:18:14 +01:00
|
|
|
layerItem.setWmsNotStandardParams(wmsNotStandardParams);
|
|
|
|
layerItem.setNcWms(isNcWms);
|
|
|
|
layerItem.setUUID(UUID);
|
|
|
|
layerItem.setZAxis(zAxis);
|
2021-09-02 12:54:39 +02:00
|
|
|
layerItem.setMinResolution(minResolution);
|
|
|
|
layerItem.setMaxResolution(maxResolution);
|
2020-10-27 16:04:34 +01:00
|
|
|
|
|
|
|
switch (layerType) {
|
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
// TODO IMPLEMENT THIS CASE
|
|
|
|
case RASTER_BASELAYER:
|
2020-10-27 16:04:34 +01:00
|
|
|
|
|
|
|
// l.setHasLegend(false);
|
2021-07-30 14:57:08 +02:00
|
|
|
layerItem.setBaseLayer(true);
|
|
|
|
layerItem.setTrasparent(false);
|
|
|
|
layerItem.setClickData(false);
|
|
|
|
break;
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
case FEATURE_TYPE:
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
// CASE FEATURE TYPE
|
|
|
|
layerItem.setBaseLayer(false);
|
|
|
|
layerItem.setClickData(true);
|
|
|
|
layerItem.setTrasparent(true);
|
|
|
|
break;
|
2020-10-27 16:04:34 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
GWT.log("styles " + styles);
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-07-30 14:57:08 +02:00
|
|
|
if (styles != null && styles.size() > 0) {
|
2020-10-29 15:18:14 +01:00
|
|
|
layerItem.setHasLegend(true);
|
|
|
|
layerItem.setDefaultStyle(styles.get(0));
|
|
|
|
layerItem.setStyle(styles.get(0));
|
|
|
|
layerItem.setStyles(styles);
|
2021-07-30 14:57:08 +02:00
|
|
|
} else {
|
2020-11-19 15:19:27 +01:00
|
|
|
String style = URLUtil.getValueOfParameter("styles", wmsLink);
|
2021-07-30 14:57:08 +02:00
|
|
|
if (style != null) { // CASE OF STYLE ="";
|
|
|
|
// TENTATIVE TO GET LEGEND
|
2020-10-29 15:18:14 +01:00
|
|
|
layerItem.setHasLegend(true);
|
2020-10-27 16:04:34 +01:00
|
|
|
}
|
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
GWT.log("Built layer: " + layerItem);
|
2020-11-19 15:19:27 +01:00
|
|
|
return layerItem;
|
2020-10-27 16:04:34 +01:00
|
|
|
}
|
2021-07-30 14:57:08 +02:00
|
|
|
|
2021-09-07 17:29:56 +02:00
|
|
|
/**
|
|
|
|
* Show popup info for layer.
|
|
|
|
*
|
2021-10-14 11:34:04 +02:00
|
|
|
* @param listGeoNaDataObject the list geo na data object
|
2022-09-06 14:53:19 +02:00
|
|
|
* @param queryClick the query click
|
2021-09-07 17:29:56 +02:00
|
|
|
*/
|
2021-09-09 15:55:33 +02:00
|
|
|
public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject, ExtentWrapped queryClick) {
|
2022-10-20 18:01:54 +02:00
|
|
|
GWT.log("showPopupInfoForLayer called for " + listGeoNaDataObject);
|
|
|
|
|
2021-09-07 17:29:56 +02:00
|
|
|
ScrollPanel scrollPanel = new ScrollPanel();
|
2021-10-15 17:51:09 +02:00
|
|
|
final FlowPanel flowPanel = new FlowPanel();
|
|
|
|
flowPanel.getElement().getStyle().setProperty("maxHeight", "600px");
|
2021-09-09 15:55:33 +02:00
|
|
|
scrollPanel.add(flowPanel);
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-11-22 10:25:09 +01:00
|
|
|
List<Button> listOpenProject = new ArrayList<Button>();
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-10-15 17:51:09 +02:00
|
|
|
final Button expandButton = new Button("Expand");
|
|
|
|
expandButton.setType(ButtonType.LINK);
|
|
|
|
expandButton.setIcon(IconType.EXPAND);
|
|
|
|
expandButton.getElement().setId("expand-query");
|
|
|
|
expandButton.setTitle("Show this view in new Window");
|
2021-09-09 15:55:33 +02:00
|
|
|
|
2021-10-15 17:51:09 +02:00
|
|
|
flowPanel.add(expandButton);
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-10-15 17:51:09 +02:00
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById("expand-query");
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
expandButton.setVisible(false);
|
2022-09-06 14:53:19 +02:00
|
|
|
// hiding the Open Project in expand mode (Modal Window)
|
2021-11-22 10:25:09 +01:00
|
|
|
for (Button butt : listOpenProject) {
|
|
|
|
butt.setVisible(false);
|
|
|
|
}
|
2021-10-15 17:51:09 +02:00
|
|
|
flowPanel.getElement().getStyle().setProperty("maxHeight", "100%");
|
|
|
|
int width = Window.getClientWidth() * 75 / 100;
|
|
|
|
int height = Window.getClientHeight() * 70 / 100;
|
|
|
|
Coordinate center = queryClick.getCenter();
|
|
|
|
double x = center.getX();
|
|
|
|
double y = center.getY();
|
2022-09-06 14:53:19 +02:00
|
|
|
// "with center x: "+x +", y: "+y;
|
2021-10-18 10:11:21 +02:00
|
|
|
ModalWindow mw = new ModalWindow("Query results...", width, height);
|
2021-10-15 17:51:09 +02:00
|
|
|
mw.add(flowPanel);
|
|
|
|
mw.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2022-12-22 11:59:07 +01:00
|
|
|
|
2022-11-18 16:50:01 +01:00
|
|
|
// //Ordering for temporal dimension
|
|
|
|
// try {
|
|
|
|
// Collections.sort(listGeoNaDataObject, new TemporalComparatorUtil());
|
|
|
|
// }catch (Exception e) {
|
|
|
|
// // TODO: handle exception
|
|
|
|
// }
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2022-10-20 18:01:54 +02:00
|
|
|
String prevProjectId = "";
|
2021-09-07 17:29:56 +02:00
|
|
|
for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
|
2021-09-09 15:55:33 +02:00
|
|
|
try {
|
2022-10-20 18:01:54 +02:00
|
|
|
|
2022-10-19 17:51:13 +02:00
|
|
|
Set<String> indexLayers = mapIndexLayerObjects.keySet();
|
2021-09-09 15:55:33 +02:00
|
|
|
LayerObject lo = geoNaSpatialQueryResult.getSourceLayerObject();
|
|
|
|
LayerItem sourceLI = lo.getLayerItem();
|
|
|
|
|
|
|
|
String layerSourceName = sourceLI.getName();
|
|
|
|
|
|
|
|
// skipping centroid layer
|
2022-10-20 18:01:54 +02:00
|
|
|
if (layerSourceName == null || indexLayers.contains(layerSourceName)
|
|
|
|
|| lo.getType().equals(LayerObjectType.INDEX_LAYER)) {
|
2021-09-09 15:55:33 +02:00
|
|
|
continue;
|
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
List<FeatureRow> features = geoNaSpatialQueryResult.getFeatures();
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
if (features == null || features.isEmpty()) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2022-10-20 18:01:54 +02:00
|
|
|
String newProjectID = lo.getProjectID();
|
|
|
|
if (prevProjectId.compareTo(newProjectID) != 0) {
|
2022-11-16 16:42:12 +01:00
|
|
|
|
2022-10-24 12:23:52 +02:00
|
|
|
ProjectDV projectDV = lo.getProjectDV();
|
2022-10-25 14:53:56 +02:00
|
|
|
String htmlMsg = ProjectUtil.toHMLCode(projectDV.getTheDocument());
|
2022-10-25 17:01:24 +02:00
|
|
|
|
|
|
|
String projectIntro = htmlMsg.length() > 100 ? StringUtil.ellipsize(htmlMsg, 100) : htmlMsg;
|
|
|
|
|
|
|
|
Label headingProfileName = new Label(lo.getProjectDV().getProfileName());
|
|
|
|
headingProfileName.setType(LabelType.WARNING);
|
|
|
|
headingProfileName.setTitle("Project ID: " + newProjectID);
|
|
|
|
headingProfileName.getElement().getStyle().setMarginBottom(10, Unit.PX);
|
|
|
|
FlowPanel headingPanel = new FlowPanel();
|
|
|
|
headingPanel.add(headingProfileName);
|
|
|
|
flowPanel.add(headingPanel);
|
2022-10-24 12:23:52 +02:00
|
|
|
flowPanel.add(new HTML(projectIntro));
|
2022-11-18 16:50:01 +01:00
|
|
|
|
2022-11-16 16:42:12 +01:00
|
|
|
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
|
|
|
if (tempRef != null) {
|
2023-02-20 15:22:51 +01:00
|
|
|
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
|
|
|
flowPanel.add(new HTML(ProjectUtil.toHTMLCode(tempRef)));
|
2022-11-16 16:42:12 +01:00
|
|
|
}
|
2022-10-20 18:01:54 +02:00
|
|
|
|
|
|
|
Button buttOpenProject = new Button("Open Project");
|
|
|
|
final String buttId = "open-details-" + Random.nextInt();
|
|
|
|
Element bEl = buttOpenProject.getElement();
|
|
|
|
bEl.setId(buttId);
|
|
|
|
bEl.getStyle().setPaddingLeft(0, Unit.PX);
|
|
|
|
buttOpenProject.setType(ButtonType.LINK);
|
|
|
|
|
|
|
|
if (buttOpenProject != null) {
|
|
|
|
flowPanel.add(buttOpenProject);
|
|
|
|
buttOpenProject.setType(ButtonType.LINK);
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById(buttId);
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
2023-01-10 14:36:37 +01:00
|
|
|
applicationBus.fireEvent(
|
|
|
|
new ShowDetailsEvent(lo.getType().name(), lo.getProfileID(),
|
|
|
|
newProjectID, null, true, EVENT_SOURCE.OPEN_PROJECTS));
|
2022-10-20 18:01:54 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
listOpenProject.add(buttOpenProject);
|
|
|
|
|
|
|
|
HTML subText = new HTML(
|
|
|
|
"<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>");
|
|
|
|
flowPanel.add(subText);
|
|
|
|
}
|
|
|
|
|
|
|
|
prevProjectId = newProjectID;
|
|
|
|
|
|
|
|
Label layerLabel = new Label();
|
|
|
|
layerLabel.setType(LabelType.INFO);
|
|
|
|
|
|
|
|
String layerName = StringUtil.fullNameToLayerName(layerSourceName, ":");
|
|
|
|
layerLabel.setText(layerName);
|
|
|
|
layerLabel.setTitle(layerSourceName);
|
|
|
|
layerLabel.getElement().getStyle().setMarginTop(10, Unit.PX);
|
|
|
|
layerLabel.getElement().getStyle().setMarginBottom(5, Unit.PX);
|
|
|
|
flowPanel.add(layerLabel);
|
|
|
|
|
|
|
|
GWT.log("Displaying " + features.size() + " features");
|
|
|
|
FlexTable intFlex = new FlexTable();
|
|
|
|
intFlex.setCellPadding(1);
|
|
|
|
intFlex.setCellSpacing(1);
|
|
|
|
intFlex.getElement().addClassName("table-feature");
|
|
|
|
intFlex.setHTML(0, 0, new HTML("Feature Id").toString());
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
for (FeatureRow feature : features) {
|
|
|
|
|
|
|
|
intFlex.setHTML(i + 1, 0, new HTML(feature.getId()).toString());
|
|
|
|
|
|
|
|
// Showing properties belonging to concessioni layer
|
|
|
|
Map<String, List<String>> entries = feature.getMapProperties();
|
|
|
|
|
|
|
|
if (entries.size() == 0) {
|
|
|
|
// Adding this row to show "no property" for feature
|
|
|
|
// intFlex.setHTML(i + 1, 1, new HTML("<i>No property</i>").toString());
|
|
|
|
}
|
|
|
|
int j = 0;
|
|
|
|
for (String key : entries.keySet()) {
|
|
|
|
List<String> theValues = entries.get(key);
|
|
|
|
String valueToDisplay = "";
|
|
|
|
for (String value : theValues) {
|
|
|
|
valueToDisplay += value + ", ";
|
|
|
|
|
|
|
|
}
|
|
|
|
valueToDisplay = valueToDisplay.substring(0, valueToDisplay.length() - 2);
|
|
|
|
|
|
|
|
// adding the keys only of first feature row. They are equal for all features
|
|
|
|
// (beloning to same layer).
|
|
|
|
if (i == 0)
|
|
|
|
intFlex.setHTML(0, j + 1, new HTML(key).toString());
|
|
|
|
|
|
|
|
intFlex.setHTML(i + 1, j + 1, new HTML(valueToDisplay).toString());
|
|
|
|
j++;
|
|
|
|
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
flowPanel.add(intFlex);
|
2021-09-09 15:55:33 +02:00
|
|
|
} catch (Exception e) {
|
2021-10-14 11:34:04 +02:00
|
|
|
GeoportalDataViewerConstants.printJs("Error: " + e.getMessage());
|
2021-09-07 17:29:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-08 14:40:36 +02:00
|
|
|
olMap.showPopup(scrollPanel.toString(), queryClick.getCenter());
|
2021-09-07 17:29:56 +02:00
|
|
|
|
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2021-09-06 17:15:38 +02:00
|
|
|
/**
|
|
|
|
* Show popup info for centroid layer.
|
|
|
|
*
|
2023-01-12 11:00:09 +01:00
|
|
|
* @param projectView the project view
|
|
|
|
*/
|
|
|
|
public void showPopupInfoForCentroidLayer(ProjectView projectView) {
|
|
|
|
GWT.log("showPopupInfoForCentroidLayer for projectView: " + projectView);
|
|
|
|
|
|
|
|
FlexTable flex = new FlexTable();
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
flex.getElement().addClassName("popup-table");
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
|
|
|
final ProjectDV projectDV = projectView.getTheProjectDV();
|
|
|
|
|
|
|
|
FlexTable intFlex = new FlexTable();
|
|
|
|
intFlex.setCellPadding(1);
|
|
|
|
intFlex.setCellSpacing(1);
|
|
|
|
if (projectDV.getTheDocument() != null) {
|
2023-02-03 11:53:37 +01:00
|
|
|
LinkedHashMap<String, Object> map = projectDV.getTheDocument().getDocumentAsMap();
|
2023-01-12 11:00:09 +01:00
|
|
|
// my-html-table
|
|
|
|
// intFlex.getElement().addClassName("my-html-table");
|
|
|
|
int i = 0;
|
|
|
|
for (String key : map.keySet()) {
|
|
|
|
try {
|
|
|
|
Object theValue = map.get(key);
|
|
|
|
String toStringValue = theValue + "";
|
|
|
|
// intFlex.setHTML(i, 0, key);
|
|
|
|
intFlex.setHTML(intFlex.getRowCount() + 1, 0, "<span title='" + toStringValue + "'>"
|
|
|
|
+ StringUtil.ellipsize(toStringValue, 100) + "</span>");
|
|
|
|
i++;
|
|
|
|
// showing the first two fields returned into document
|
|
|
|
if (i == 2)
|
|
|
|
break;
|
|
|
|
} catch (Exception e) {
|
|
|
|
// TODO: handle exception
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, intFlex.getElement().getString());
|
|
|
|
}
|
|
|
|
|
|
|
|
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
2023-01-17 17:02:23 +01:00
|
|
|
GWT.log("Temporal reference is: "+tempRef);
|
2023-01-12 11:00:09 +01:00
|
|
|
if (tempRef != null) {
|
2023-02-20 15:22:51 +01:00
|
|
|
|
|
|
|
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, ProjectUtil.toHTMLCode(tempRef));
|
2023-01-12 11:00:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
List<SectionView> selections = projectView.getListSections();
|
|
|
|
|
|
|
|
boolean firstImageFound = false;
|
|
|
|
for (SectionView sectionView : selections) {
|
|
|
|
List<SubDocumentView> subDocuments = sectionView.getListSubDocuments();
|
|
|
|
for (SubDocumentView subDoc : subDocuments) {
|
|
|
|
List<FilesetDV> images = subDoc.getListImages();
|
|
|
|
if (images != null && images.size() > 0) {
|
|
|
|
for (FilesetDV fileset : images) {
|
|
|
|
List<PayloadDV> payloads = fileset.getListPayload();
|
|
|
|
if (payloads != null && payloads.size() > 0) {
|
|
|
|
PayloadDV img = payloads.get(0);
|
|
|
|
if (img != null && img.getLink() != null) {
|
2023-03-30 16:21:49 +02:00
|
|
|
String theImgHTML = "<div id='pop-img'><img src=\"" + img.getLink() + "\"></img></div>";
|
2023-01-12 11:00:09 +01:00
|
|
|
GWT.log("theImgHTML: " + theImgHTML);
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, theImgHTML);
|
|
|
|
firstImageFound = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (firstImageFound)
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (firstImageFound)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Button buttonOpenDtl = new Button("Open Details");
|
|
|
|
buttonOpenDtl.getElement().setId("open-details");
|
|
|
|
buttonOpenDtl.setType(ButtonType.LINK);
|
|
|
|
|
|
|
|
buttonOpenDtl.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
GWT.log("Open Details clicked");
|
|
|
|
ShowDetailsEvent toEvent = new ShowDetailsEvent(LayerObjectType.INDEX_LAYER.name(),
|
|
|
|
projectDV.getProfileID(), projectDV.getId(), null, true, EVENT_SOURCE.OPEN_DETAILS);
|
|
|
|
applicationBus.fireEvent(toEvent);
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
final Button buttonViewLayers = new Button("Zoom to Layers");
|
|
|
|
buttonViewLayers.getElement().setId("go-to-layers");
|
|
|
|
buttonViewLayers.getElement().setTitle("Zoom to Layers");
|
|
|
|
buttonViewLayers.setType(ButtonType.LINK);
|
|
|
|
|
|
|
|
if (olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) {
|
|
|
|
buttonViewLayers.setVisible(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
buttonViewLayers.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
GWT.log("View Layers clicked");
|
|
|
|
fireGoToLayers();
|
|
|
|
buttonViewLayers.setVisible(false);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
FlowPanel flow = new FlowPanel();
|
|
|
|
flow.add(buttonOpenDtl);
|
|
|
|
flow.add(buttonViewLayers);
|
|
|
|
vpPanel.add(flow);
|
|
|
|
|
|
|
|
Coordinate positionTo = null;
|
|
|
|
|
|
|
|
GeoJSON spatialReference = projectDV.getSpatialReference();
|
|
|
|
if (spatialReference == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
ExtentWrapped ew = new ExtentWrapped(spatialReference.getBbox().getMinX(),
|
|
|
|
spatialReference.getBbox().getMinY(), spatialReference.getBbox().getMaxX(),
|
|
|
|
spatialReference.getBbox().getMaxY());
|
|
|
|
|
|
|
|
positionTo = MapUtils.transformCoordiante(ew.getCenter(), MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
} catch (Exception e) {
|
|
|
|
GWT.log("Error on calculating center of the extent " + e.getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
// fallback
|
|
|
|
if (positionTo == null)
|
|
|
|
return;
|
|
|
|
|
|
|
|
final Coordinate centerTo = positionTo;
|
|
|
|
new Timer() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
olMap.showPopup(vpPanel.toString(), centerTo);
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById("open-details");
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
|
|
|
|
ShowDetailsEvent toEvent = new ShowDetailsEvent(LayerObjectType.INDEX_LAYER.name(),
|
|
|
|
projectDV.getProfileID(), projectDV.getId(), null, true,
|
|
|
|
EVENT_SOURCE.OPEN_DETAILS);
|
|
|
|
applicationBus.fireEvent(toEvent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById("go-to-layers");
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
// buttonElement.setAttribute("visible", "none");
|
|
|
|
// buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
|
|
|
|
fireGoToLayers();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}.schedule(OpenLayerMap.SET_CENTER_ANIMATED_DURATION + 100);
|
|
|
|
|
|
|
|
olMap.setCenter(centerTo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show popup info for centroid layer after clicking on map
|
|
|
|
*
|
2021-09-07 17:29:56 +02:00
|
|
|
* @param geoNaDataObject the geo na data object
|
|
|
|
* @param feature the feature
|
2021-09-06 17:15:38 +02:00
|
|
|
* @param onFailureCenterTo the on failure center to
|
|
|
|
*/
|
|
|
|
public void showPopupInfoForCentroidLayer(GeoNaSpatialQueryResult geoNaDataObject, FeatureRow feature,
|
|
|
|
Coordinate onFailureCenterTo) {
|
2022-11-07 17:58:06 +01:00
|
|
|
GWT.log("showPopupInfoForCentroidLayer showing feature: " + feature);
|
|
|
|
GWT.log("showPopupInfoForCentroidLayer showing layerObject: " + geoNaDataObject.getSourceLayerObject());
|
2022-10-19 17:51:13 +02:00
|
|
|
|
2021-09-06 17:15:38 +02:00
|
|
|
FlexTable flex = new FlexTable();
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
flex.getElement().addClassName("popup-table");
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
2022-11-07 17:58:06 +01:00
|
|
|
ProjectDV projectDV = geoNaDataObject.getSourceLayerObject().getProjectDV();
|
|
|
|
|
2022-11-16 16:42:12 +01:00
|
|
|
if (projectDV != null) {
|
|
|
|
|
2022-11-07 17:58:06 +01:00
|
|
|
FlexTable intFlex = new FlexTable();
|
|
|
|
intFlex.setCellPadding(1);
|
|
|
|
intFlex.setCellSpacing(1);
|
2022-11-16 16:42:12 +01:00
|
|
|
if (projectDV.getTheDocument() != null) {
|
2023-02-03 11:53:37 +01:00
|
|
|
LinkedHashMap<String, Object> map = projectDV.getTheDocument().getDocumentAsMap();
|
2022-11-16 16:42:12 +01:00
|
|
|
// my-html-table
|
|
|
|
// intFlex.getElement().addClassName("my-html-table");
|
|
|
|
// int i = 0;
|
|
|
|
for (String key : map.keySet()) {
|
|
|
|
try {
|
|
|
|
Object theValue = map.get(key);
|
|
|
|
String toStringValue = theValue + "";
|
|
|
|
// intFlex.setHTML(i, 0, key);
|
2022-11-18 16:50:01 +01:00
|
|
|
intFlex.setHTML(intFlex.getRowCount() + 1, 0, "<span title='" + toStringValue + "'>"
|
|
|
|
+ StringUtil.ellipsize(toStringValue, 100) + "</span>");
|
2022-11-16 16:42:12 +01:00
|
|
|
// i++;
|
|
|
|
} catch (Exception e) {
|
|
|
|
// TODO: handle exception
|
|
|
|
}
|
2022-11-07 17:58:06 +01:00
|
|
|
}
|
2022-11-16 16:42:12 +01:00
|
|
|
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, intFlex.getElement().getString());
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 16:42:12 +01:00
|
|
|
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
|
|
|
if (tempRef != null) {
|
2023-02-20 15:22:51 +01:00
|
|
|
if(tempRef.getStart()!=null || tempRef.getEnd()!=null)
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, ProjectUtil.toHTMLCode(tempRef));
|
2022-11-16 16:42:12 +01:00
|
|
|
}
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
2022-11-07 17:58:06 +01:00
|
|
|
|
2021-09-06 17:15:38 +02:00
|
|
|
if (geoNaDataObject.getMapImages() != null) {
|
|
|
|
for (String key : geoNaDataObject.getMapImages().keySet()) {
|
2022-10-19 17:51:13 +02:00
|
|
|
List<PayloadDV> listUI = geoNaDataObject.getMapImages().get(key);
|
2021-09-06 17:15:38 +02:00
|
|
|
GWT.log("Adding images: " + listUI);
|
|
|
|
if (listUI != null && listUI.size() > 0) {
|
2022-10-19 17:51:13 +02:00
|
|
|
PayloadDV img = listUI.get(0);
|
|
|
|
if (img != null && img.getLink() != null) {
|
2023-03-30 16:21:49 +02:00
|
|
|
String theImgHTML = "<div id='pop-img'><img src=\"" + img.getLink() + "\"></img></div>";
|
2021-09-06 17:15:38 +02:00
|
|
|
GWT.log("theImgHTML: " + theImgHTML);
|
|
|
|
// GeoportalDataViewerConstants.print("The row are:
|
|
|
|
// "+flex.getRowCount());
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, theImgHTML);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GWT.log("The selected Feature is: " + feature);
|
|
|
|
FeatureRow theFeature = feature;
|
2022-12-22 11:59:07 +01:00
|
|
|
Button buttonOpenDtl = new Button("Open Details");
|
|
|
|
buttonOpenDtl.getElement().setId("open-details");
|
|
|
|
buttonOpenDtl.setType(ButtonType.LINK);
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
buttonOpenDtl.addClickHandler(new ClickHandler() {
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
GWT.log("Open Details clicked");
|
|
|
|
fireOpenDetails(geoNaDataObject.getSourceLayerObject(), theFeature);
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
}
|
|
|
|
});
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-09 15:29:01 +01:00
|
|
|
final Button buttonViewLayers = new Button("Zoom to Layers");
|
2022-12-22 11:59:07 +01:00
|
|
|
buttonViewLayers.getElement().setId("go-to-layers");
|
|
|
|
buttonViewLayers.getElement().setTitle("Zoom to Layers");
|
|
|
|
buttonViewLayers.setType(ButtonType.LINK);
|
2023-01-10 14:36:37 +01:00
|
|
|
|
|
|
|
if (olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) {
|
2022-12-22 16:38:43 +01:00
|
|
|
buttonViewLayers.setVisible(false);
|
|
|
|
}
|
2022-12-22 11:59:07 +01:00
|
|
|
|
|
|
|
buttonViewLayers.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
GWT.log("View Layers clicked");
|
|
|
|
fireGoToLayers();
|
2022-12-22 16:38:43 +01:00
|
|
|
buttonViewLayers.setVisible(false);
|
2022-12-22 11:59:07 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
FlowPanel flow = new FlowPanel();
|
|
|
|
flow.add(buttonOpenDtl);
|
|
|
|
flow.add(buttonViewLayers);
|
|
|
|
vpPanel.add(flow);
|
|
|
|
|
|
|
|
Coordinate positionTo = null;
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
if (feature == null) {
|
|
|
|
positionTo = onFailureCenterTo;
|
|
|
|
} else {
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
GWT.log("geometry is: " + feature.getGeometry());
|
|
|
|
if (feature.getGeometry() != null) {
|
|
|
|
GWT.log("trasforming geometry: " + feature.getGeometry().getToJSONObject());
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
Geometry geom = new GeoJson().readGeometry(feature.getGeometry().getToJSONObject(), null);
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
// POINT
|
|
|
|
if (geom.getType().equalsIgnoreCase("Point")) {
|
|
|
|
GWT.log("geometry: is a point");
|
|
|
|
String coordinateJSON = feature.getGeometry().getCoordinatesJSON();
|
|
|
|
JSONArray centerJSON = (JSONArray) JSONParser.parseStrict(coordinateJSON);
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
Coordinate center = new Coordinate(new Double(centerJSON.get(0).toString()),
|
|
|
|
new Double(centerJSON.get(1).toString()));
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
if (feature.getCrsName() != null
|
|
|
|
&& feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
center = MapUtils.transformCoordiante(center, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
}
|
|
|
|
positionTo = center;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Extent geomExtent = geom.getExtent();
|
|
|
|
|
|
|
|
Coordinate lower = OLFactory.createCoordinate(geomExtent.getLowerLeftX(),
|
|
|
|
geomExtent.getLowerLeftY());
|
|
|
|
Coordinate upper = OLFactory.createCoordinate(geomExtent.getUpperRightX(),
|
|
|
|
geomExtent.getUpperRightY());
|
|
|
|
Coordinate lowerCoord = lower;
|
|
|
|
Coordinate upperCoord = upper;
|
|
|
|
if (feature.getCrsName() != null
|
|
|
|
&& feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
|
|
|
lowerCoord = MapUtils.transformCoordiante(lower, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
upperCoord = MapUtils.transformCoordiante(upper, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
}
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
ExtentWrapped ew = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(),
|
|
|
|
upperCoord.getY());
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
positionTo = new Coordinate(ew.getCenter().getX(), ew.getCenter().getY());
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
}
|
|
|
|
GWT.log("positionTo is: " + positionTo);
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// fallback
|
2022-12-22 11:59:07 +01:00
|
|
|
if (positionTo == null)
|
|
|
|
positionTo = onFailureCenterTo;
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
final Coordinate centerTo = positionTo;
|
|
|
|
new Timer() {
|
2021-09-06 17:15:38 +02:00
|
|
|
|
|
|
|
@Override
|
2022-12-22 11:59:07 +01:00
|
|
|
public void run() {
|
|
|
|
olMap.showPopup(vpPanel.toString(), centerTo);
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
2021-09-06 17:15:38 +02:00
|
|
|
|
|
|
|
@Override
|
2022-12-22 11:59:07 +01:00
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById("open-details");
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
fireOpenDetails(geoNaDataObject.getSourceLayerObject(), theFeature);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
|
|
|
Element buttonElement = DOM.getElementById("go-to-layers");
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
2023-01-10 14:36:37 +01:00
|
|
|
// buttonElement.setAttribute("visible", "none");
|
|
|
|
// buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
|
2022-12-22 11:59:07 +01:00
|
|
|
fireGoToLayers();
|
2023-01-10 14:36:37 +01:00
|
|
|
|
2022-12-22 11:59:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
2022-12-22 11:59:07 +01:00
|
|
|
|
2021-09-06 17:15:38 +02:00
|
|
|
});
|
2022-12-22 11:59:07 +01:00
|
|
|
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
2022-09-06 14:53:19 +02:00
|
|
|
|
2022-12-22 16:38:43 +01:00
|
|
|
}.schedule(OpenLayerMap.SET_CENTER_ANIMATED_DURATION + 100);
|
2022-12-22 11:59:07 +01:00
|
|
|
|
|
|
|
olMap.setCenter(centerTo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
/**
|
|
|
|
* Fire go to layers.
|
|
|
|
*/
|
2022-12-22 11:59:07 +01:00
|
|
|
protected void fireGoToLayers() {
|
2023-01-24 10:23:37 +01:00
|
|
|
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 0.1);
|
2022-12-22 11:59:07 +01:00
|
|
|
olMap.setZoom(zoomValue);
|
2022-12-22 16:38:43 +01:00
|
|
|
try {
|
|
|
|
Element buttonElement = DOM.getElementById("go-to-layers");
|
|
|
|
buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
|
2023-01-10 14:36:37 +01:00
|
|
|
} catch (Exception e) {
|
2022-12-22 16:38:43 +01:00
|
|
|
// TODO: handle exception
|
|
|
|
}
|
2022-12-22 11:59:07 +01:00
|
|
|
}
|
2021-09-06 17:15:38 +02:00
|
|
|
|
2023-01-12 11:00:09 +01:00
|
|
|
/**
|
|
|
|
* Fire open details.
|
|
|
|
*
|
|
|
|
* @param layerObject the layer object
|
|
|
|
* @param theFeature the the feature
|
|
|
|
*/
|
2022-12-22 11:59:07 +01:00
|
|
|
protected void fireOpenDetails(LayerObject layerObject, FeatureRow theFeature) {
|
|
|
|
ShowDetailsEvent toEvent = parseGeonaReferences(layerObject, theFeature);
|
|
|
|
applicationBus.fireEvent(toEvent);
|
2021-09-06 17:15:38 +02:00
|
|
|
}
|
|
|
|
|
2020-10-27 16:41:30 +01:00
|
|
|
/**
|
|
|
|
* Sets the ol map.
|
|
|
|
*
|
|
|
|
* @param olMap the new ol map
|
|
|
|
*/
|
2021-11-12 16:57:57 +01:00
|
|
|
public void setOLMap(OpenLayerMap olMap) {
|
2020-10-27 16:41:30 +01:00
|
|
|
this.olMap = olMap;
|
|
|
|
}
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2020-11-19 15:19:27 +01:00
|
|
|
/**
|
|
|
|
* Gets the layer manager bus.
|
|
|
|
*
|
|
|
|
* @return the layer manager bus
|
|
|
|
*/
|
|
|
|
public HandlerManager getLayerManagerBus() {
|
|
|
|
return layerManagerBus;
|
|
|
|
}
|
2020-10-27 16:04:34 +01:00
|
|
|
|
2021-10-14 11:34:04 +02:00
|
|
|
/**
|
|
|
|
* Gets the overlay layer manager.
|
|
|
|
*
|
|
|
|
* @return the overlay layer manager
|
|
|
|
*/
|
|
|
|
public OverlayLayerManager getOverlayLayerManager() {
|
|
|
|
return overlayLayerManager;
|
|
|
|
}
|
|
|
|
|
2020-10-27 16:04:34 +01:00
|
|
|
}
|