added console.log to debug

This commit is contained in:
Francesco Mangiacrapa 2020-11-24 12:26:38 +01:00
parent 609f38678e
commit 8564db4079
5 changed files with 192 additions and 154 deletions

View File

@ -2,6 +2,13 @@ package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayersMapParameters;
/**
* The Class GeoportalDataViewerConstants.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 24, 2020
*/
public class GeoportalDataViewerConstants {
public static final String EPSG_4326 = "EPSG:4326";
@ -18,6 +25,13 @@ public class GeoportalDataViewerConstants {
public static final String GET_ZOOM = OpenLayersMapParameters.OL_MAP_PARAM.zoom.name();
public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name();
/**
* The Enum LayerType.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Nov 24, 2020
*/
public enum LayerType {RASTER_BASELAYER, FEATURE_TYPE};
public static final int MAX_WFS_FEATURES = 3; // zero for no limit
@ -33,4 +47,14 @@ public class GeoportalDataViewerConstants {
public static final int MAP_ITALY_FIT_ZOOM_ON = 6;
/**
* Prints the.
*
* @param msg the msg
*/
public static native void print(String msg)/*-{
console.log(msg);
}-*/;
}

View File

@ -137,12 +137,16 @@ public class LayerManager {
@Override
public void onFailure(Throwable caught) {
GeoportalDataViewerConstants.print("on Failure DataResult: "+caught.getMessage());
}
@Override
public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
try {
GWT.log("GeoNaDataObject's: "+listGeonaDataObjects);
GeoportalDataViewerConstants.print("GeoNaDataObject's: "+listGeonaDataObjects);
if(listGeonaDataObjects==null || listGeonaDataObjects.isEmpty())
return;
@ -178,7 +182,7 @@ public class LayerManager {
}
flex.setText(1, 0, reducedValue);
}else if(key.equalsIgnoreCase("date_scavo")) {
flex.setHTML(2, 0, new HTML("<code>"+theValue).toString()+"</code>");
flex.setHTML(2, 0, new HTML("<code>"+theValue+"</code>").toString());
}
}
@ -234,6 +238,7 @@ public class LayerManager {
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);
}
}
@ -248,6 +253,7 @@ public class LayerManager {
return;
GWT.log("The selected Feature is: "+feature);
GeoportalDataViewerConstants.print("The selected Feature is: "+feature);
FeatureRow theFeature = feature;
Button button = null;
if(!featureFound) {
@ -275,13 +281,17 @@ public class LayerManager {
});
}
Coordinate centerTo = null;
if(feature.getGeometry()!=null) {
PointsPath path = feature.getGeometry().getPath();
GWT.log("Points Path: "+path);
Coordinate centerTo = null;
if(path!=null && path.getCoordinates()!=null && path.getCoordinates().length>0) {
org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.Coordinate center = path.getCoordinates()[0];
centerTo = new Coordinate(center.getX(), center.getY());
}
}
if(centerTo==null)
centerTo = queryEvent.getoLCoordinate();
@ -307,6 +317,9 @@ public class LayerManager {
}
});
}
}catch (Exception e) {
GeoportalDataViewerConstants.print(e.getMessage());
}
}
});
}

View File

@ -215,6 +215,7 @@ public abstract class OpenLayerOSM {
public void showPopup(String html, Coordinate coordinate) {
GWT.log("Showing popup on: "+coordinate);
GeoportalDataViewerConstants.print("Showing popup on: "+coordinate);
Element elPopup = DOM.getElementById("popup");
elPopup.getStyle().setVisibility(Visibility.VISIBLE);
if(popupOverlay==null) {

View File

@ -18,7 +18,7 @@
<b:DropdownButton type="LINK" text=" " icon="INFO">
<g:HTMLPanel ui:field="panelMI"
addStyleNames="info-interaction">
<g:Label>Map Interaction</g:Label>
<g:Label>Map Interactions</g:Label>
<b:Paragraph><b:Icon type="CHECK_EMPTY"/> Use <code>Shift+Drag</code> to draw an extent for zoom in the Map</b:Paragraph>
<b:Paragraph><b:Icon type="HAND_UP"/> Click on the Points shown on the Map to view their features</b:Paragraph>
</g:HTMLPanel>

View File

@ -81,15 +81,15 @@ public class ConvertToDataViewModel {
theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser()));
theConcessione.setLicenzaID(concessione.getLicenzaID());
theConcessione.setNome(concessione.getNome());
theConcessione.setParoleChiaveICCD(concessione.getParoleChiaveICCD());
theConcessione.setParoleChiaveLibere(concessione.getParoleChiaveLibere());
theConcessione.setParoleChiaveICCD(toListString(concessione.getParoleChiaveICCD()));
theConcessione.setParoleChiaveLibere(toListString(concessione.getParoleChiaveLibere()));
theConcessione.setResponsabile(concessione.getResponsabile());
theConcessione.setRisorseCorrelate(concessione.getRisorseCorrelate());
theConcessione.setRisorseCorrelate(toListString(concessione.getRisorseCorrelate()));
theConcessione.setSoggetto(concessione.getSoggetto());
theConcessione.setTitolareCopyright(concessione.getTitolareCopyright());
theConcessione.setTitolareLicenza(concessione.getTitolareLicenza());
theConcessione.setTitolari(concessione.getTitolari());
theConcessione.setTitolari(toListString(concessione.getTitolari()));
theConcessione.setVersion(concessione.getVersion());
theConcessione.setRecordType(concessione.getRecordType().name());
@ -199,7 +199,7 @@ public class ConvertToDataViewModel {
theRelazioneDiScavo.setLicenseID(relazioneScavo.getLicenseID());
theRelazioneDiScavo.setPolicy(toPolicy(relazioneScavo.getPolicy()));
//theRelazioneDiScavo.setRecord(recordDV);
theRelazioneDiScavo.setResponsabili(relazioneScavo.getResponsabili());
theRelazioneDiScavo.setResponsabili(toListString(relazioneScavo.getResponsabili()));
theRelazioneDiScavo.setSoggetto(relazioneScavo.getSoggetto());
theRelazioneDiScavo.setTitolo(relazioneScavo.getTitolo());
@ -227,7 +227,7 @@ public class ConvertToDataViewModel {
theUploadedImageDV.setLicenseID(uploadedImage.getLicenseID());
theUploadedImageDV.setPolicy(toPolicy(uploadedImage.getPolicy()));
//theUploadedImageDV.setRecord(recordDV);
theUploadedImageDV.setResponsabili(uploadedImage.getResponsabili());
theUploadedImageDV.setResponsabili(toListString(uploadedImage.getResponsabili()));
theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto());
theUploadedImageDV.setTitolo(uploadedImage.getTitolo());
@ -284,7 +284,7 @@ public class ConvertToDataViewModel {
theLayerConessione.setLayerName(layerConcessione.getLayerName());
theLayerConessione.setLayerID(layerConcessione.getLayerID());
theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID());
theLayerConessione.setAuthors(layerConcessione.getAuthors());
theLayerConessione.setAuthors(toListString(layerConcessione.getAuthors()));
BoundsMap bounds = toBoundMap(layerConcessione.getBbox());
theLayerConessione.setBbox(bounds);
theLayerConessione.setCreationTime(toDateString(layerConcessione.getCreationTime()));