merged with master

This commit is contained in:
Francesco Mangiacrapa 2023-01-25 12:06:22 +01:00
parent 2b28f53652
commit 7247c3d4b6
5 changed files with 21 additions and 28 deletions

View File

@ -77,8 +77,6 @@ import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -89,18 +87,13 @@ import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import ol.Coordinate;
import ol.Feature;
import ol.OLFactory;
import ol.Options;
import ol.format.GeoJson;
import ol.format.GeoJsonFeatureOptions;
import ol.format.GeoJsonOptions;
import ol.geom.Geometry;
import ol.layer.LayerOptions;
import ol.proj.Projection;
import ol.proj.ProjectionOptions;
import ol.source.Vector;
import ol.Feature;
import ol.FeatureOptions;
/**
* Entry point classes define <code>onModuleLoad()</code>.

View File

@ -1344,7 +1344,7 @@ public class LayerManager {
* Fire go to layers.
*/
protected void fireGoToLayers() {
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 1);
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 0.1);
olMap.setZoom(zoomValue);
try {
Element buttonElement = DOM.getElementById("go-to-layers");

View File

@ -40,7 +40,6 @@ import ol.animation.AnimationOptions;
import ol.color.Color;
import ol.event.EventListener;
import ol.geom.Geometry;
import ol.geom.Point;
import ol.interaction.Draw;
import ol.interaction.DrawOptions;
import ol.interaction.Extent;
@ -69,7 +68,6 @@ import ol.style.FillOptions;
import ol.style.Stroke;
import ol.style.StrokeOptions;
import ol.style.Style;
import ol.style.TextOptions;
/**
* The Class OpenLayerMap.
@ -80,6 +78,8 @@ import ol.style.TextOptions;
*/
public abstract class OpenLayerMap {
private static final int MAX_LENGHT_CQL_FOR_GET_REQUEST = 1600; //1600 characters
public static final int SET_CENTER_ANIMATED_DURATION = 500;
public static final int ZOOM_ANIMATED_DURATION = 3000;
@ -467,7 +467,7 @@ public abstract class OpenLayerMap {
ImageWms imageWMSSource = wmsLayer.getSource();
ImageWmsParams imageWMSParams = imageWMSSource.getParams();
if (cqlFilterExpression == null) {
if (cqlFilterExpression == null || cqlFilterExpression.length()>MAX_LENGHT_CQL_FOR_GET_REQUEST) {
imageWMSParams.delete("CQL_FILTER");
} else {
imageWMSParams.set("CQL_FILTER", cqlFilterExpression);
@ -476,6 +476,8 @@ public abstract class OpenLayerMap {
imageWMSSource.updateParams(imageWMSParams);
wmsLayer.setSource(imageWMSSource);
wmsLayer.changed();
// map.addLayer(wmsLayer);
}

View File

@ -101,6 +101,8 @@ public class LayersSectionViewer extends Composite {
BBOXDV bbox = layer.getBbox();
try {
if(bbox!=null) {
if(!GWT.isProdMode()) {
@ -124,6 +126,15 @@ public class LayersSectionViewer extends Composite {
layerPanel.add(alert);
}
} catch (Exception e) {
Alert alert = new Alert();
alert.setType(AlertType.ERROR);
alert.setHTML("Error on adding the layer to Map. Please check its WMS link: <br/>"+layer.getWMSLink());
alert.getElement().getStyle().setProperty("wordBreak", "break-all");
alert.setClose(false);
layerPanel.add(alert);
}
String htmlLinkId = mapView.getPanelMapElementId() + "-image-download";
@ -138,18 +149,6 @@ public class LayersSectionViewer extends Composite {
@Override
public void onClick(ClickEvent event) {
// DOWNLOAD only the layer by Geoserver
/*
* Map<String, String> mapLayerURLs =
* mapView.getLightOLSM().getLayerURLsProperty(); Collection<String> layerURLs =
* mapLayerURLs.values(); ArrayList<String> layers = new
* ArrayList<String>(layerURLs); exportPDF(layers.get(0)); String layerURL =
* mapLayerURLs.get(layerDV.getLayerName()); GWT.log("layerDV name is: " +
* layerDV.getLayerName()); if (layerURL != null) Window.open(layerURL,
* "_blank", null);
*/
downloadAttempt++;
if (downloadAttempt > 3) {
@ -160,7 +159,6 @@ public class LayersSectionViewer extends Composite {
// DOWNLOAD the OSM + layer by canvas
downloadMap(mapView.getLightOLM().getMap(), mapView.getPanelMapElementId(), htmlLinkId, filename,
mimeType);
// mapExport(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId());
}
});

View File

@ -313,9 +313,9 @@ public class SearchFacilityUI extends Composite {
message += ". ";
}
if (returnedItems > 0) {
message += "On the map you can see all the projects with a centroid matching the query";
}
// if (returnedItems > 0) {
// message += "On the map you can see all the projects with a centroid matching the query";
// }
HTML resultMessage = new HTML(message);
resultMessage.getElement().addClassName("search_result_msg");