|
|
|
@ -57,6 +57,7 @@ import com.google.gwt.user.client.EventListener;
|
|
|
|
|
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.FlowPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
@ -147,7 +148,6 @@ public class LayerManager {
|
|
|
|
|
GWT.log("MAX_WFS_FEATURES is: " + GeoportalDataViewerConstants.MAX_WFS_FEATURES);
|
|
|
|
|
// GeoportalDataViewerConstants.print("calling getDataResult");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<LayerObject> listLO = new ArrayList<LayerObject>();
|
|
|
|
|
// for querying base layers
|
|
|
|
|
listLO.addAll(mapBaseLayerObjects.values());
|
|
|
|
@ -223,9 +223,8 @@ public class LayerManager {
|
|
|
|
|
// to a record/concessione (not centroid layer),
|
|
|
|
|
// so calling show popuup info on detail layers if the
|
|
|
|
|
// following events are true.
|
|
|
|
|
if (sourceEvent
|
|
|
|
|
.equals(MapEventType.MOUSE_CLICK)
|
|
|
|
|
&& olMap.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
|
|
|
|
|
if (sourceEvent.equals(MapEventType.MOUSE_CLICK) && olMap
|
|
|
|
|
.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
|
|
|
|
|
|
|
|
|
|
// Here I need to pass only the visible layers
|
|
|
|
|
showPopupInfoForLayer(listGeonaDataObjects,
|
|
|
|
@ -244,8 +243,8 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
GWT.log("the product id is: " + theProductId);
|
|
|
|
|
// Displaying popup info for centroid layer
|
|
|
|
|
if (sourceEvent
|
|
|
|
|
.equals(MapEventType.MOUSE_CLICK) || sourceEvent.equals(MapEventType.ADDED_CENTROID_LAYER_TO_MAP)){
|
|
|
|
|
if (sourceEvent.equals(MapEventType.MOUSE_CLICK)
|
|
|
|
|
|| sourceEvent.equals(MapEventType.ADDED_CENTROID_LAYER_TO_MAP)) {
|
|
|
|
|
showPopupInfoForCentroidLayer(geoNaDataObject, feature,
|
|
|
|
|
queryEvent.getQueryClickExtent().getCenter());
|
|
|
|
|
}
|
|
|
|
@ -271,7 +270,8 @@ public class LayerManager {
|
|
|
|
|
layer.getLayerName(), layer.getWmsLink(),
|
|
|
|
|
false, false, layer.getLayerUUID(), true,
|
|
|
|
|
OLMapManager.LAYER_DETAIL_MIN_RESOLUTION,
|
|
|
|
|
OLMapManager.LAYER_DETAIL_MAX_RESOLUTION,layer.getRefersTo());
|
|
|
|
|
OLMapManager.LAYER_DETAIL_MAX_RESOLUTION,
|
|
|
|
|
layer.getRefersTo());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -357,7 +357,8 @@ public class LayerManager {
|
|
|
|
|
*/
|
|
|
|
|
public void addLayer(final String geonaItemType, final String layerTitle, final String layerName,
|
|
|
|
|
final String wmsLink, final boolean isBase, final boolean displayInLayerSwitcher, final String UUID,
|
|
|
|
|
final boolean asDetailLayer, Double minResolution, Double maxResolution, BaseConcessioneDV refersToBaseConcessione) {
|
|
|
|
|
final boolean asDetailLayer, Double minResolution, Double maxResolution,
|
|
|
|
|
BaseConcessioneDV refersToBaseConcessione) {
|
|
|
|
|
|
|
|
|
|
// final LayoutContainer westPanel = (LayoutContainer) layersPanel.getParent();
|
|
|
|
|
//
|
|
|
|
@ -520,16 +521,15 @@ public class LayerManager {
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
* @param onFailureCenterTo the on failure center to
|
|
|
|
|
*/
|
|
|
|
|
public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject,
|
|
|
|
|
ExtentWrapped queryClick) {
|
|
|
|
|
public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject, ExtentWrapped queryClick) {
|
|
|
|
|
|
|
|
|
|
ScrollPanel scrollPanel = new ScrollPanel();
|
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
scrollPanel.add(vpPanel);
|
|
|
|
|
FlowPanel flowPanel = new FlowPanel();
|
|
|
|
|
scrollPanel.add(flowPanel);
|
|
|
|
|
|
|
|
|
|
String prevConcessioneName = "";
|
|
|
|
|
for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
GWT.log("baseLayerFromISProfile.getName() :" + baseLayerFromISProfile.getName());
|
|
|
|
|
LayerObject lo = geoNaSpatialQueryResult.getSourceLayerObject();
|
|
|
|
|
LayerItem sourceLI = lo.getLayerItem();
|
|
|
|
@ -537,7 +537,8 @@ public class LayerManager {
|
|
|
|
|
String layerSourceName = sourceLI.getName();
|
|
|
|
|
|
|
|
|
|
// skipping centroid layer
|
|
|
|
|
if(layerSourceName==null || layerSourceName.compareToIgnoreCase(baseLayerFromISProfile.getName())==0) {
|
|
|
|
|
if (layerSourceName == null
|
|
|
|
|
|| layerSourceName.compareToIgnoreCase(baseLayerFromISProfile.getName()) == 0) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -546,9 +547,10 @@ public class LayerManager {
|
|
|
|
|
String concessioneIntro = StringUtil.ellipsize(lo.getSourceConcessione().getNome(), 40);
|
|
|
|
|
Heading heading = new Heading(4, concessioneIntro);
|
|
|
|
|
heading.getElement().getStyle().setMarginBottom(10, Unit.PX);
|
|
|
|
|
vpPanel.add(heading);
|
|
|
|
|
HTML subText = new HTML("<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>");
|
|
|
|
|
vpPanel.add(subText);
|
|
|
|
|
flowPanel.add(heading);
|
|
|
|
|
HTML subText = new HTML(
|
|
|
|
|
"<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>");
|
|
|
|
|
flowPanel.add(subText);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prevConcessioneName = nomeConcessione;
|
|
|
|
@ -559,7 +561,7 @@ public class LayerManager {
|
|
|
|
|
layerLabel.setText(layerSourceName);
|
|
|
|
|
layerLabel.getElement().getStyle().setMarginTop(10, Unit.PX);
|
|
|
|
|
layerLabel.getElement().getStyle().setMarginBottom(5, Unit.PX);
|
|
|
|
|
vpPanel.add(layerLabel);
|
|
|
|
|
flowPanel.add(layerLabel);
|
|
|
|
|
|
|
|
|
|
List<FeatureRow> features = geoNaSpatialQueryResult.getFeatures();
|
|
|
|
|
|
|
|
|
@ -568,29 +570,32 @@ public class LayerManager {
|
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
|
flex.getElement().addClassName("table-feature");
|
|
|
|
|
flex.setHTML(0, 0, new HTML("No data available").toString());
|
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
flex.setHTML(0, 0, new HTML("<i>No data available</i>").toString());
|
|
|
|
|
flowPanel.add(flex);
|
|
|
|
|
continue;
|
|
|
|
|
// olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (FeatureRow feature : features) {
|
|
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
intFlex.setHTML(1, 0, new HTML(feature.getId()).toString());
|
|
|
|
|
|
|
|
|
|
// Showing properties belonging to concessioni centroid layer
|
|
|
|
|
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) {
|
|
|
|
|
intFlex.setHTML(1, 1, new HTML("No property available").toString());
|
|
|
|
|
//Adding this row to show "no property" for feature
|
|
|
|
|
//intFlex.setHTML(i + 1, 1, new HTML("<i>No property</i>").toString());
|
|
|
|
|
}
|
|
|
|
|
int j = 1;
|
|
|
|
|
int j = 0;
|
|
|
|
|
for (String key : entries.keySet()) {
|
|
|
|
|
List<String> theValues = entries.get(key);
|
|
|
|
|
String valueToDisplay = "";
|
|
|
|
@ -599,13 +604,21 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
valueToDisplay = valueToDisplay.substring(0, valueToDisplay.length() - 2);
|
|
|
|
|
intFlex.setHTML(0, j, new HTML(key).toString());
|
|
|
|
|
intFlex.setHTML(1, j, new HTML(valueToDisplay).toString());
|
|
|
|
|
|
|
|
|
|
// 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++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vpPanel.add(intFlex);
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
flowPanel.add(intFlex);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
GeoportalDataViewerConstants.printJs("Error: "+e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -613,6 +626,106 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 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,
|
|
|
|
|
// ExtentWrapped queryClick) {
|
|
|
|
|
//
|
|
|
|
|
// ScrollPanel scrollPanel = new ScrollPanel();
|
|
|
|
|
// VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
// scrollPanel.add(vpPanel);
|
|
|
|
|
//
|
|
|
|
|
// String prevConcessioneName = "";
|
|
|
|
|
// for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
|
|
|
|
|
//
|
|
|
|
|
// GWT.log("baseLayerFromISProfile.getName() :"+baseLayerFromISProfile.getName());
|
|
|
|
|
// LayerObject lo = geoNaSpatialQueryResult.getSourceLayerObject();
|
|
|
|
|
// LayerItem sourceLI = lo.getLayerItem();
|
|
|
|
|
//
|
|
|
|
|
// String layerSourceName = sourceLI.getName();
|
|
|
|
|
//
|
|
|
|
|
// //skipping centroid layer
|
|
|
|
|
// if(layerSourceName==null || layerSourceName.compareToIgnoreCase(baseLayerFromISProfile.getName())==0) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// String nomeConcessione = lo.getSourceConcessione().getNome();
|
|
|
|
|
// if(prevConcessioneName.compareTo(nomeConcessione)!=0) {
|
|
|
|
|
// String concessioneIntro = StringUtil.ellipsize(lo.getSourceConcessione().getNome(), 40);
|
|
|
|
|
// Heading heading = new Heading(4, concessioneIntro);
|
|
|
|
|
// heading.getElement().getStyle().setMarginBottom(10, Unit.PX);
|
|
|
|
|
// vpPanel.add(heading);
|
|
|
|
|
// HTML subText = new HTML("<p style=\"color:#999; font-size:14px; margin:5px 0 5px 0;\">Layers and Properties</p>");
|
|
|
|
|
// vpPanel.add(subText);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// prevConcessioneName = nomeConcessione;
|
|
|
|
|
//
|
|
|
|
|
// Label layerLabel = new Label();
|
|
|
|
|
// layerLabel.setType(LabelType.INFO);
|
|
|
|
|
//
|
|
|
|
|
// layerLabel.setText(layerSourceName);
|
|
|
|
|
// 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(), queryClick.getCenter());
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show popup info for centroid layer.
|
|
|
|
|
*
|
|
|
|
|