|
|
|
@ -27,6 +27,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.ZoomOutOverMini
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.ModalWindow;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
|
|
|
|
@ -41,6 +42,7 @@ import com.github.gwtbootstrap.client.ui.Button;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Heading;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Label;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
@ -286,8 +288,9 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(List<LayerConcessioneDV> result) {
|
|
|
|
|
GWT.log("Adding layers: " + result);
|
|
|
|
|
|
|
|
|
|
for (LayerConcessioneDV layer : result) {
|
|
|
|
|
GWT.log("Adding layer: " + layer.getLayerName());
|
|
|
|
|
addLayer("concessione", layer.getLayerName(),
|
|
|
|
|
layer.getLayerName(), layer.getWmsLink(),
|
|
|
|
|
false, false, layer.getLayerUUID(), true,
|
|
|
|
@ -551,10 +554,62 @@ public class LayerManager {
|
|
|
|
|
public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject, ExtentWrapped queryClick) {
|
|
|
|
|
|
|
|
|
|
ScrollPanel scrollPanel = new ScrollPanel();
|
|
|
|
|
FlowPanel flowPanel = new FlowPanel();
|
|
|
|
|
// flowPanel.getElement().getStyle().setProperty("maxHeight", "600px");
|
|
|
|
|
final FlowPanel flowPanel = new FlowPanel();
|
|
|
|
|
flowPanel.getElement().getStyle().setProperty("maxHeight", "600px");
|
|
|
|
|
scrollPanel.add(flowPanel);
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
|
|
/*expandButton.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
flowPanel.getElement().getStyle().setProperty("maxHeight", "100%");
|
|
|
|
|
int width = Window.getClientWidth() * 75 / 100;
|
|
|
|
|
int height = Window.getClientHeight() * 70 / 100;
|
|
|
|
|
ModalWindow mw = new ModalWindow("Query view", width, height);
|
|
|
|
|
mw.add(flowPanel);
|
|
|
|
|
mw.show();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});*/
|
|
|
|
|
|
|
|
|
|
flowPanel.add(expandButton);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
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();
|
|
|
|
|
//"with center x: "+x +", y: "+y;
|
|
|
|
|
ModalWindow mw = new ModalWindow("Query view", width, height);
|
|
|
|
|
mw.add(flowPanel);
|
|
|
|
|
mw.show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//fillLayersAndProperties(listGeoNaDataObject, expandButton, flowPanel);
|
|
|
|
|
|
|
|
|
|
String prevConcessioneName = "";
|
|
|
|
|
for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
|
|
|
|
|
try {
|
|
|
|
@ -578,8 +633,9 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
String nomeConcessione = lo.getSourceConcessione().getNome();
|
|
|
|
|
if (prevConcessioneName.compareTo(nomeConcessione) != 0) {
|
|
|
|
|
String concessioneIntro = StringUtil.ellipsize(lo.getSourceConcessione().getNome(), 40);
|
|
|
|
|
String concessioneIntro = nomeConcessione.length()>100? StringUtil.ellipsize(nomeConcessione, 100):nomeConcessione;
|
|
|
|
|
Heading heading = new Heading(4, concessioneIntro);
|
|
|
|
|
heading.setTitle(nomeConcessione);
|
|
|
|
|
heading.getElement().getStyle().setMarginBottom(10, Unit.PX);
|
|
|
|
|
flowPanel.add(heading);
|
|
|
|
|
HTML subText = new HTML(
|
|
|
|
@ -599,19 +655,6 @@ public class LayerManager {
|
|
|
|
|
layerLabel.getElement().getStyle().setMarginBottom(5, Unit.PX);
|
|
|
|
|
flowPanel.add(layerLabel);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
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("<i>No data available</i>").toString());
|
|
|
|
|
flowPanel.add(flex);
|
|
|
|
|
continue;
|
|
|
|
|
// olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
GWT.log("Displaying " + features.size() + " features");
|
|
|
|
|
FlexTable intFlex = new FlexTable();
|
|
|
|
|
intFlex.setCellPadding(1);
|
|
|
|
|