|
|
|
@ -14,6 +14,7 @@ import org.gcube.application.geoportalcommon.shared.products.model.LayerConcessi
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.model.UploadedImageDV;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MapEventType;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEvent;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.AddedLayerToMapEventHandler;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.QueryDataEvent;
|
|
|
|
@ -35,10 +36,13 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformation
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis;
|
|
|
|
|
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Button;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Label;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
|
|
|
@ -52,6 +56,7 @@ import com.google.gwt.user.client.Window;
|
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
|
import com.google.gwt.user.client.ui.FlexTable;
|
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
|
|
|
|
|
|
import ol.Coordinate;
|
|
|
|
@ -78,6 +83,8 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
private HandlerManager applicationBus;
|
|
|
|
|
|
|
|
|
|
private org.gcube.application.geoportalcommon.shared.LayerItem baseLayerFromISProfile;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Instantiates a new layer manager.
|
|
|
|
|
*
|
|
|
|
@ -110,23 +117,9 @@ public class LayerManager {
|
|
|
|
|
// for (LayerObject layerObj : layerObjects.values()) {
|
|
|
|
|
// // TODO
|
|
|
|
|
// isLayerVisible(layerObj.getLayerItem());
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
BoundsMap mapBBOX = new BoundsMap();
|
|
|
|
|
// THIS IS SHOULD BE CORRET, THE BOUND AND CRS ARE READ FROM MAP
|
|
|
|
|
/*
|
|
|
|
|
* mapBBOX.setCrs(olMap.getProjectionCode());
|
|
|
|
|
* mapBBOX.setLowerLeftX(olMap.getExtent().getLowerLeftX());
|
|
|
|
|
* mapBBOX.setLowerLeftY(olMap.getExtent().getLowerLeftY());
|
|
|
|
|
* mapBBOX.setUpperRightX(olMap.getExtent().getUpperRightX());
|
|
|
|
|
* mapBBOX.setUpperRightY(olMap.getExtent().getUpperRightY());
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// THE FOLLOWING SHOULD BE NOT NEEDED BUT THE GETFEATURE WITH EPSG_3857 SEEMS
|
|
|
|
|
// NOT WORK IN OUR GEOSERVER
|
|
|
|
|
// double minX = olMap.getExtent().getLowerLeftX();
|
|
|
|
|
// double minY = olMap.getExtent().getLowerLeftY();
|
|
|
|
|
double minX = queryEvent.getGeoQuery().getX1();
|
|
|
|
|
double minY = queryEvent.getGeoQuery().getY1();
|
|
|
|
|
Coordinate centerCoordinate = new Coordinate(minX, minY);
|
|
|
|
@ -150,6 +143,16 @@ public class LayerManager {
|
|
|
|
|
GWT.log("Bounds is: " + mapBBOX);
|
|
|
|
|
GWT.log("MAX_WFS_FEATURES is: " + GeoportalDataViewerConstants.MAX_WFS_FEATURES);
|
|
|
|
|
// GeoportalDataViewerConstants.print("calling getDataResult");
|
|
|
|
|
|
|
|
|
|
// List<String> mapLayers = olMap.getLayers();
|
|
|
|
|
//// List<LayerObject> listLO = new ArrayList<LayerObject>(mapLayers.size());
|
|
|
|
|
// for (String layerName : mapLayers) {
|
|
|
|
|
//// LayerItem layerItem = new LayerItem();
|
|
|
|
|
//// layerItem.setName(layerName);
|
|
|
|
|
//// listLO.add(new LayerObject("Concessione",layerItem));
|
|
|
|
|
// GWT.log("Layer found: "+layerName);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
List<LayerObject> listLO = new ArrayList<LayerObject>(layerObjects.values());
|
|
|
|
|
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(listLO, olMap.getProjectionCode(),
|
|
|
|
|
mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(),
|
|
|
|
@ -165,28 +168,26 @@ public class LayerManager {
|
|
|
|
|
public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
|
|
|
|
|
|
|
|
|
|
GWT.log("GeoNaDataObject's is/are " + listGeonaDataObjects.size());
|
|
|
|
|
GWT.log("GeoNaDataObject's: " + listGeonaDataObjects);
|
|
|
|
|
//GWT.log("GeoNaDataObject's: " + listGeonaDataObjects);
|
|
|
|
|
// GeoportalDataViewerConstants.print("GeoNaDataObject's:
|
|
|
|
|
// "+listGeonaDataObjects);
|
|
|
|
|
|
|
|
|
|
if (listGeonaDataObjects == null || listGeonaDataObjects.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
FlexTable flex = new FlexTable();
|
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
|
flex.getElement().addClassName("popup-table");
|
|
|
|
|
boolean featureFound = false;
|
|
|
|
|
FeatureRow feature = null;
|
|
|
|
|
|
|
|
|
|
// TODO SWTCH FOR EARCH ITEM TYPE
|
|
|
|
|
for (GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
|
|
|
|
|
List<FeatureRow> features = geoNaDataObject.getFeatures();
|
|
|
|
|
|
|
|
|
|
GWT.log("GeoNaDataObject Source layer item name: "
|
|
|
|
|
+ geoNaDataObject.getSourceLayerObject().getLayerItem().getName());
|
|
|
|
|
|
|
|
|
|
// USING ONLY THE FIRST FEATURE IN THE LIST
|
|
|
|
|
if (features != null && features.size() > 0) {
|
|
|
|
|
String theProductId = null;
|
|
|
|
|
// I need to show exaclty the feature with produc_id == recordId
|
|
|
|
|
// I need to show exactly the feature with produc_id == recordId
|
|
|
|
|
if (mongoItemId != null) {
|
|
|
|
|
for (FeatureRow fRow : features) {
|
|
|
|
|
List<String> productIdLst = fRow.getMapProperties()
|
|
|
|
@ -212,9 +213,19 @@ public class LayerManager {
|
|
|
|
|
List<String> productIdLst = feature.getMapProperties()
|
|
|
|
|
.get("product_id");
|
|
|
|
|
if (productIdLst == null) {
|
|
|
|
|
// in this case the feature returned is a (detail) layer belonging
|
|
|
|
|
// in this case the feature/s returned is/are a (detail) layer/s
|
|
|
|
|
// belonging
|
|
|
|
|
// to a record/concessione (not centroid layer),
|
|
|
|
|
// so returning
|
|
|
|
|
// so calling show popuup info on detail layers if the
|
|
|
|
|
// following events are true.
|
|
|
|
|
if (queryEvent.getSourceMapEventType()
|
|
|
|
|
.equals(MapEventType.MOUSE_CLICK)
|
|
|
|
|
&& olMap.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
|
|
|
|
|
|
|
|
|
|
//Here I need to pass only the visible layers
|
|
|
|
|
showPopupInfoForLayer(listGeonaDataObjects,
|
|
|
|
|
queryEvent.getOnFailureCenterTo());
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
theProductId = productIdLst.get(0);
|
|
|
|
@ -227,8 +238,9 @@ public class LayerManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GWT.log("the product id is: " + theProductId);
|
|
|
|
|
//Displaying popup info for centroid layer
|
|
|
|
|
showPopupInfoForCentroidLayer(geoNaDataObject, feature, queryEvent.getOnFailureCenterTo());
|
|
|
|
|
// Displaying popup info for centroid layer
|
|
|
|
|
showPopupInfoForCentroidLayer(geoNaDataObject, feature,
|
|
|
|
|
queryEvent.getOnFailureCenterTo());
|
|
|
|
|
|
|
|
|
|
// retrieving and showing WMS layers of a concessione if the ZOOM level is >
|
|
|
|
|
// QUERY_MIN_ZOOM_LEVEL
|
|
|
|
@ -261,186 +273,7 @@ public class LayerManager {
|
|
|
|
|
// QUERY_MIN_ZOOM_LEVEL
|
|
|
|
|
olMap.removeAllDetailLayers();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Showing properties belonging to concessioni centroid layer
|
|
|
|
|
// Map<String, List<String>> entries = feature.getMapProperties();
|
|
|
|
|
//
|
|
|
|
|
// String nome = "";
|
|
|
|
|
// String descrizione = "";
|
|
|
|
|
// String date = "";
|
|
|
|
|
//
|
|
|
|
|
// for (String key : entries.keySet()) {
|
|
|
|
|
// String theValue = entries.get(key).get(0);
|
|
|
|
|
// if (key.equalsIgnoreCase("nome")) {
|
|
|
|
|
// nome = theValue != null ? theValue : "";
|
|
|
|
|
// } else if (key.equalsIgnoreCase("descrizione")) {
|
|
|
|
|
// descrizione = theValue != null ? theValue : "";
|
|
|
|
|
// } else if (key.equalsIgnoreCase("date_scavo")) {
|
|
|
|
|
// date = theValue != null ? theValue : "";
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// GeoportalDataViewerConstants.print("0: "+nome);
|
|
|
|
|
// flex.setHTML(0, 0, new HTML(nome).toString());
|
|
|
|
|
// try {
|
|
|
|
|
// descrizione = StringUtil.ellipsize(descrizione, 100);
|
|
|
|
|
// GWT.log("reduced: " + descrizione);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// GWT.log("error: " + e.getMessage());
|
|
|
|
|
// }
|
|
|
|
|
// // GeoportalDataViewerConstants.print("1: "+descrizione);
|
|
|
|
|
// flex.setText(1, 0, descrizione);
|
|
|
|
|
// // GeoportalDataViewerConstants.print("2: "+date);
|
|
|
|
|
// date = StringUtil.formatDate(date);
|
|
|
|
|
// flex.setHTML(2, 0, new HTML("<code>" + date + "</code>").toString());
|
|
|
|
|
|
|
|
|
|
// if (geoNaDataObject.getMapImages() != null) {
|
|
|
|
|
// for (String key : geoNaDataObject.getMapImages().keySet()) {
|
|
|
|
|
// List<UploadedImageDV> listUI = geoNaDataObject.getMapImages()
|
|
|
|
|
// .get(key);
|
|
|
|
|
// GWT.log("Adding images: " + listUI);
|
|
|
|
|
// if (listUI != null && listUI.size() > 0) {
|
|
|
|
|
// UploadedImageDV img = listUI.get(0);
|
|
|
|
|
// if (img.getListWsContent() != null) {
|
|
|
|
|
// WorkspaceContentDV wsContent = img.getListWsContent()
|
|
|
|
|
// .get(img.getListWsContent().size() - 1);
|
|
|
|
|
// String theImgHTML = "<img src=\"" + wsContent.getLink()
|
|
|
|
|
// + "\"></img>";
|
|
|
|
|
// GWT.log("theImgHTML: " + theImgHTML);
|
|
|
|
|
// // GeoportalDataViewerConstants.print("The row are:
|
|
|
|
|
// // "+flex.getRowCount());
|
|
|
|
|
// flex.setHTML(flex.getRowCount() + 1, 0, theImgHTML);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// featureFound = true;
|
|
|
|
|
// break; //Only the first one
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (feature == null)
|
|
|
|
|
// return;
|
|
|
|
|
//
|
|
|
|
|
// GWT.log("The selected Feature is: " + feature);
|
|
|
|
|
// // GeoportalDataViewerConstants.print("The selected Feature is: "+feature);
|
|
|
|
|
// FeatureRow theFeature = feature;
|
|
|
|
|
// Button button = null;
|
|
|
|
|
// if (!featureFound) {
|
|
|
|
|
// flex.setHTML(0, 0, new HTML("No data available").toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// button = new Button("Open Details");
|
|
|
|
|
// button.getElement().setId("open-details");
|
|
|
|
|
// button.setType(ButtonType.LINK);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
// vpPanel.add(flex);
|
|
|
|
|
|
|
|
|
|
// if (button != null) {
|
|
|
|
|
// vpPanel.add(button);
|
|
|
|
|
// button.setType(ButtonType.LINK);
|
|
|
|
|
// button.addClickHandler(new ClickHandler() {
|
|
|
|
|
//
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onClick(ClickEvent event) {
|
|
|
|
|
// ShowDetailsEvent toEvent = parseGeonaReferences(
|
|
|
|
|
// geoNaDataObject.getSourceLayerObject().getItemType(),
|
|
|
|
|
// theFeature);
|
|
|
|
|
// applicationBus.fireEvent(toEvent);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// Coordinate centerTo = null;
|
|
|
|
|
// GWT.log("geometry is: " + feature.getGeometry());
|
|
|
|
|
// if (feature.getGeometry() != null) {
|
|
|
|
|
// GWT.log("trasforming geometry: " + feature.getGeometry().getToJSONObject());
|
|
|
|
|
//
|
|
|
|
|
// Geometry geom = new GeoJson()
|
|
|
|
|
// .readGeometry(feature.getGeometry().getToJSONObject(), null);
|
|
|
|
|
//
|
|
|
|
|
// // POINT
|
|
|
|
|
// if (geom.getType().equalsIgnoreCase("Point")) {
|
|
|
|
|
// GWT.log("geometry: is a point");
|
|
|
|
|
// String coordinateJSON = feature.getGeometry().getCoordinatesJSON();
|
|
|
|
|
// JSONArray centerJSON = (JSONArray) JSONParser
|
|
|
|
|
// .parseStrict(coordinateJSON);
|
|
|
|
|
//// Coordinate center = OLFactory.createCoordinate(
|
|
|
|
|
//// new Double(centerJSON.get(0).toString()),
|
|
|
|
|
//// new Double(centerJSON.get(1).toString()));
|
|
|
|
|
//
|
|
|
|
|
// Coordinate center = new Coordinate(
|
|
|
|
|
// new Double(centerJSON.get(0).toString()),
|
|
|
|
|
// new Double(centerJSON.get(1).toString()));
|
|
|
|
|
//
|
|
|
|
|
// if (feature.getCrsName() != null && feature.getCrsName()
|
|
|
|
|
// .endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
//
|
|
|
|
|
// center = MapUtils.transformCoordiante(center,
|
|
|
|
|
// MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
// MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
// }
|
|
|
|
|
// centerTo = 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());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// ExtentWrapped ew = new ExtentWrapped(lowerCoord.getX(),
|
|
|
|
|
// lowerCoord.getY(), upperCoord.getX(), upperCoord.getY());
|
|
|
|
|
//
|
|
|
|
|
// centerTo = new Coordinate(ew.getCenter().getX(), ew.getCenter().getY());
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// GWT.log("center is: " + centerTo);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // fallback
|
|
|
|
|
// if (centerTo == null)
|
|
|
|
|
// centerTo = queryEvent.getOnFailureCenterTo();
|
|
|
|
|
//
|
|
|
|
|
// 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 = parseGeonaReferences(
|
|
|
|
|
// geoNaDataObject.getSourceLayerObject()
|
|
|
|
|
// .getItemType(),
|
|
|
|
|
// theFeature);
|
|
|
|
|
// applicationBus.fireEvent(toEvent);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -655,11 +488,96 @@ public class LayerManager {
|
|
|
|
|
return layerItem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show popup info for layer.
|
|
|
|
|
*
|
|
|
|
|
* @param geoNaDataObject the geo na data object
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
* @param onFailureCenterTo the on failure center to
|
|
|
|
|
*/
|
|
|
|
|
public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject,
|
|
|
|
|
Coordinate onFailureCenterTo) {
|
|
|
|
|
|
|
|
|
|
ScrollPanel scrollPanel = new ScrollPanel();
|
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
scrollPanel.add(vpPanel);
|
|
|
|
|
|
|
|
|
|
for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
|
|
|
|
|
|
|
|
|
|
GWT.log("baseLayerFromISProfile.getName() :"+baseLayerFromISProfile.getName());
|
|
|
|
|
String layerSource = geoNaSpatialQueryResult.getSourceLayerObject().getLayerItem().getName();
|
|
|
|
|
|
|
|
|
|
//skipping centroid layer
|
|
|
|
|
if(layerSource==null || layerSource.compareToIgnoreCase(baseLayerFromISProfile.getName())==0) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label layerLabel = new Label();
|
|
|
|
|
layerLabel.setType(LabelType.INFO);
|
|
|
|
|
|
|
|
|
|
layerLabel.setText(layerSource);
|
|
|
|
|
layerLabel.getElement().getStyle().setMarginTop(10, Unit.PX);
|
|
|
|
|
layerLabel.getElement().getStyle().setMarginBottom(5, Unit.PX);
|
|
|
|
|
vpPanel.add(layerLabel);
|
|
|
|
|
|
|
|
|
|
List<FeatureRow> features = geoNaSpatialQueryResult.getFeatures();
|
|
|
|
|
|
|
|
|
|
if (features == null || features.isEmpty()) {
|
|
|
|
|
FlexTable flex = new FlexTable();
|
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
|
flex.getElement().addClassName("table-feature");
|
|
|
|
|
flex.setHTML(0, 0, new HTML("No data available").toString());
|
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
continue;
|
|
|
|
|
//olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (FeatureRow feature : 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());
|
|
|
|
|
intFlex.setHTML(1, 0, new HTML(feature.getId()).toString());
|
|
|
|
|
|
|
|
|
|
// Showing properties belonging to concessioni centroid layer
|
|
|
|
|
Map<String, List<String>> entries = feature.getMapProperties();
|
|
|
|
|
|
|
|
|
|
if (entries.size() == 0) {
|
|
|
|
|
intFlex.setHTML(1, 1, new HTML("No property available").toString());
|
|
|
|
|
}
|
|
|
|
|
int j = 1;
|
|
|
|
|
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);
|
|
|
|
|
intFlex.setHTML(0, j, new HTML(key).toString());
|
|
|
|
|
intFlex.setHTML(1, j, new HTML(valueToDisplay).toString());
|
|
|
|
|
j++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vpPanel.add(intFlex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
olMap.showPopup(scrollPanel.toString(), onFailureCenterTo);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show popup info for centroid layer.
|
|
|
|
|
*
|
|
|
|
|
* @param geoNaDataObject the geo na data object
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
* @param geoNaDataObject the geo na data object
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
* @param onFailureCenterTo the on failure center to
|
|
|
|
|
*/
|
|
|
|
|
public void showPopupInfoForCentroidLayer(GeoNaSpatialQueryResult geoNaDataObject, FeatureRow feature,
|
|
|
|
@ -673,8 +591,8 @@ public class LayerManager {
|
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
|
|
|
|
|
if (feature == null) {
|
|
|
|
|
olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
flex.setHTML(0, 0, new HTML("No data available").toString());
|
|
|
|
|
olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -856,4 +774,12 @@ public class LayerManager {
|
|
|
|
|
return layerManagerBus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setBaseLayerFromIsProfile(org.gcube.application.geoportalcommon.shared.LayerItem layerItem) {
|
|
|
|
|
this.baseLayerFromISProfile = layerItem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public org.gcube.application.geoportalcommon.shared.LayerItem getBaseLayerFromISProile() {
|
|
|
|
|
return baseLayerFromISProfile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|