From 69e5216645125d5507a1c7fe0ad37c46d9078f1e Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 24 Jan 2023 10:23:37 +0100 Subject: [PATCH] commented console.log. Added MaxLenght to CQL Filter --- .../client/GeoportalDataViewerConstants.java | 4 ++-- .../user/geoportaldataviewer/client/LayerManager.java | 2 +- .../geoportaldataviewer/client/gis/OpenLayerMap.java | 8 ++++++-- .../client/ui/cms/gallery/ImagesSectionGallery.java | 2 +- .../client/ui/cms/layers/LayersSectionViewer.java | 2 +- .../ui/cms/project/relation/TimelineRelationPanel.java | 10 +++++----- .../client/ui/cms/search/SearchFacilityUI.java | 6 +++--- .../client/ui/dialogs/DialogShareableLink.java | 2 +- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerConstants.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerConstants.java index 7741424..89b4ac6 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerConstants.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewerConstants.java @@ -87,7 +87,7 @@ public class GeoportalDataViewerConstants { * @param msg the msg */ public static native void printJs(String msg)/*-{ - console.log("js console: " + msg); + //console.log("js console: " + msg); }-*/; /** @@ -96,7 +96,7 @@ public class GeoportalDataViewerConstants { * @param msg the msg */ public static native void printJsObj(Object object)/*-{ - console.log("js obj: " + JSON.stringify(object, null, 4)); + //console.log("js obj: " + JSON.stringify(object, null, 4)); }-*/; /** diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java index cb563fd..cdaa281 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/LayerManager.java @@ -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"); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java index 471280d..6dbac22 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/gis/OpenLayerMap.java @@ -72,6 +72,8 @@ import ol.source.XyzOptions; */ 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; @@ -459,7 +461,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); @@ -467,8 +469,10 @@ public abstract class OpenLayerMap { imageWMSSource.updateParams(imageWMSParams); wmsLayer.setSource(imageWMSSource); + + wmsLayer.changed(); - // map.addLayer(wmsLayer); + //map.addLayer(wmsLayer); } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/gallery/ImagesSectionGallery.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/gallery/ImagesSectionGallery.java index 1b76d50..bace8e9 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/gallery/ImagesSectionGallery.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/gallery/ImagesSectionGallery.java @@ -49,7 +49,7 @@ public class ImagesSectionGallery { */ private native void showGallery(JavaScriptObject json_array_images, String galleryDivId) /*-{ - console.log("showing: " + json_array_images) + //console.log("showing: " + json_array_images) var waitForJQuery = setInterval( function() { if (typeof $wnd.$ != 'undefined') { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java index c2aac43..240badd 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java @@ -189,7 +189,7 @@ public class LayersSectionViewer extends Composite { */ public static native void downloadMap(ol.Map map, String mapPanelId, String linkId, String filename, String mimeType)/*-{ - console.log("map: " + map); + //console.log("map: " + map); map.once('rendercomplete', function() { var mapCanvas = $doc.createElement('canvas'); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/project/relation/TimelineRelationPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/project/relation/TimelineRelationPanel.java index 7df0cc0..d8d2825 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/project/relation/TimelineRelationPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/project/relation/TimelineRelationPanel.java @@ -157,19 +157,19 @@ public class TimelineRelationPanel extends Composite { public static native String instanceTimeline(String idDivContainer, JSONArray jsonItems, TimelineRelationPanel instance) /*-{ - console.log('showTimeline_instanceTimeline for json items: ' - + jsonItems); + console.log('showing timeline'); + //console.log('showTimeline_instanceTimeline for json items: '+jsonItems); - console.log("showTimeline_template: " + $wnd.templateHandlebars); + //console.log("showTimeline_template: " + $wnd.templateHandlebars); // DOM element where the Timeline will be attached var container = $doc.getElementById(idDivContainer); - console.log("showTimeline_container: " + container); + //console.log("showTimeline_container: " + container); var myArray = $wnd.JSON.parse(jsonItems); - console.log("showTimeline_jsonItems: " + myArray); + //console.log("showTimeline_jsonItems: " + myArray); var container = $doc.getElementById(idDivContainer); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/search/SearchFacilityUI.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/search/SearchFacilityUI.java index c6efba0..621090d 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/search/SearchFacilityUI.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/search/SearchFacilityUI.java @@ -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"); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/dialogs/DialogShareableLink.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/dialogs/DialogShareableLink.java index ac7398d..9cfb016 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/dialogs/DialogShareableLink.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/dialogs/DialogShareableLink.java @@ -396,7 +396,7 @@ public class DialogShareableLink extends Composite { private native void copyToClipboard(String myDivId) /*-{ var copyText = $doc.getElementById(myDivId); - console.log("text copied is :" + copyText.value); + //console.log("text copied is :" + copyText.value); copyText.select(); //For mobile devices copyText.setSelectionRange(0, 99999);