added js logs. Commented common maps

This commit is contained in:
Francesco Mangiacrapa 2020-12-02 17:52:06 +01:00
parent ccb506fa3b
commit 34ebb8d648
4 changed files with 24 additions and 2 deletions

View File

@ -135,7 +135,7 @@
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<!-- <version>[1.1.0, 2.0.0-SNAPSHOT)</version> -->
<scope>compile</scope>
<!-- <scope>compile</scope> -->
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>

View File

@ -121,6 +121,7 @@ public class GeoportalDataViewer implements EntryPoint {
Long.parseLong(paramGeonaItemID);
}catch (Exception e) {
Window.alert("Bad format for parameter "+GeoportalDataViewerConstants.GET_GEONA_ITEM_ID+". It must be a Long");
paramGeonaItemID = null;
}
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@ -247,17 +248,20 @@ public class GeoportalDataViewer implements EntryPoint {
@Override
public void onLayerRendered(AddedLayerToMapEvent addedLayerToMapEvent) {
GWT.log("Fired AddedLayerToMapEvent "+addedLayerToMapEvent.getLayerItem());
GeoportalDataViewerConstants.print("Fired AddedLayerToMapEvent "+addedLayerToMapEvent.getLayerItem());
//the parameter gid has been passed in the query string
if(paramGeonaItemID!=null && mainPanel.getDisplyedRecord()!=null) {
RecordDV record = mainPanel.getDisplyedRecord();
GWT.log("record instanceof ConcessioneDV: " +(record instanceof ConcessioneDV));
GeoportalDataViewerConstants.print("record instanceof ConcessioneDV: " +(record instanceof ConcessioneDV));
if(record instanceof ConcessioneDV) {
ConcessioneDV concessioneDV = (ConcessioneDV) record;
Double x = concessioneDV.getCentroidLong();
Double y = concessioneDV.getCentroidLat();
Coordinate transfCoord = MapUtils.transformCoordiante(new Coordinate(x, y), GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
GeoQuery select = olMapMng.toDataPointQuery(transfCoord);
GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, transfCoord, record.getId()));
}
}

View File

@ -90,6 +90,7 @@ public class LayerManager {
@Override
public void onQueryInteraction(final QueryDataEvent queryEvent) {
GeoportalDataViewerConstants.print("fired QueryDataEvent: "+queryEvent.toString());
if(queryEvent.getGeoQuery()!=null) {
GeoQuery selectDataInfo = queryEvent.getGeoQuery();
@ -136,6 +137,8 @@ public class LayerManager {
GWT.log("Bounds is: "+mapBBOX);
GWT.log("MAX_WFS_FEATURES is: "+GeoportalDataViewerConstants.MAX_WFS_FEATURES);
GeoportalDataViewerConstants.print("calling getDataResult");
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(layerObjects, olMap.getProjectionCode(), mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(), new AsyncCallback<List<GeoNaSpatialQueryResult>>() {
@Override

View File

@ -67,4 +67,19 @@ public class QueryDataEvent extends GwtEvent<QueryDataEventHandler> {
public Coordinate getoLCoordinate() {
return oLCoordinate;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("QueryDataEvent [select=");
builder.append(select);
builder.append(", oLCoordinate=");
builder.append(oLCoordinate);
builder.append(", recordId=");
builder.append(recordId);
builder.append("]");
return builder.toString();
}
}