bug fixing and improvements

This commit is contained in:
Francesco Mangiacrapa 2021-09-08 17:13:59 +02:00
parent 3d003a7429
commit 35c5ede770
5 changed files with 12 additions and 9 deletions

View File

@ -284,7 +284,7 @@ public class GeoportalDataViewer implements EntryPoint {
@Override @Override
public void run() { public void run() {
attempt++; attempt++;
GWT.log("waiting got record tenative: " + attempt); GWT.log("waiting get record: " + attempt);
RecordDV record = mainPanel.getDisplyedRecord(); RecordDV record = mainPanel.getDisplyedRecord();
if (record != null) { if (record != null) {
this.cancel(); this.cancel();
@ -360,7 +360,7 @@ public class GeoportalDataViewer implements EntryPoint {
// GeoportalDataViewerConstants.print("fireEvent QueryDataEvent"); // GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
ExtentWrapped toExt = new ExtentWrapped(transfCoord.getX(), transfCoord.getY(), transfCoord.getX(), transfCoord.getY()); ExtentWrapped toExt = new ExtentWrapped(transfCoord.getX(), transfCoord.getY(), transfCoord.getX(), transfCoord.getY());
layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, toExt, layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, toExt,
record.getItemId(), true, MapEventType.ADDED_LAYER_TO_MAP)); record.getItemId(), true, MapEventType.ADDED_CENTROID_LAYER_TO_MAP));
} else { } else {
GeoportalDataViewerConstants.printJs( GeoportalDataViewerConstants.printJs(
"I cannot select the point one or both coordiantes are null. X: " + x + ", Y:" + y); "I cannot select the point one or both coordiantes are null. X: " + x + ", Y:" + y);

View File

@ -26,7 +26,7 @@ public class GeoportalDataViewerConstants {
public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name(); public static final String GET_CENTER_MAP_TO_LONG_LAT = OpenLayersMapParameters.OL_MAP_PARAM.centermap.name();
public static enum MapEventType { public static enum MapEventType {
MOUSE_CLICK, MAP_ZOOM_END, MOVE_END, ADDED_LAYER_TO_MAP MOUSE_CLICK, MAP_ZOOM_END, MOVE_END, ADDED_CENTROID_LAYER_TO_MAP
} }
/** /**

View File

@ -178,6 +178,8 @@ public class LayerManager {
FeatureRow feature = null; FeatureRow feature = null;
MapEventType sourceEvent = queryEvent.getSourceMapEventType();
// TODO SWTCH FOR EARCH ITEM TYPE // TODO SWTCH FOR EARCH ITEM TYPE
for (GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) { for (GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
List<FeatureRow> features = geoNaDataObject.getFeatures(); List<FeatureRow> features = geoNaDataObject.getFeatures();
@ -219,7 +221,7 @@ public class LayerManager {
// to a record/concessione (not centroid layer), // to a record/concessione (not centroid layer),
// so calling show popuup info on detail layers if the // so calling show popuup info on detail layers if the
// following events are true. // following events are true.
if (queryEvent.getSourceMapEventType() if (sourceEvent
.equals(MapEventType.MOUSE_CLICK) .equals(MapEventType.MOUSE_CLICK)
&& olMap.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) { && olMap.getCurrentZoomLevel() > OLMapManager.QUERY_MIN_ZOOM_LEVEL) {
@ -240,8 +242,8 @@ public class LayerManager {
GWT.log("the product id is: " + theProductId); GWT.log("the product id is: " + theProductId);
// Displaying popup info for centroid layer // Displaying popup info for centroid layer
if (queryEvent.getSourceMapEventType() if (sourceEvent
.equals(MapEventType.MOUSE_CLICK)){ .equals(MapEventType.MOUSE_CLICK) || sourceEvent.equals(MapEventType.ADDED_CENTROID_LAYER_TO_MAP)){
showPopupInfoForCentroidLayer(geoNaDataObject, feature, showPopupInfoForCentroidLayer(geoNaDataObject, feature,
queryEvent.getQueryClickExtent().getCenter()); queryEvent.getQueryClickExtent().getCenter());
} }

View File

@ -158,7 +158,8 @@ public class OLMapManager {
// adding a tolerance in case of manual click // adding a tolerance in case of manual click
if (manualClick) { if (manualClick) {
// adding a tolerance for clicking // adding a tolerance for clicking
geoWidth = (bboxWidth / w) * (14 / 2); //geoWidth = (bboxWidth / w) * (14 / 2);
geoWidth = (bboxWidth / w) * (16 / 2);
} else { } else {
// data point selection for coordinate loaded from concessione // data point selection for coordinate loaded from concessione
geoWidth = (bboxWidth / w) * (2); geoWidth = (bboxWidth / w) * (2);

View File

@ -283,8 +283,8 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
String userName = user == null ? null : user.getUsername(); String userName = user == null ? null : user.getUsername();
//TODO THIS IS A WORKAROUND WAITING FOR USER ROLE. //TODO THIS IS A WORKAROUND WAITING FOR USER ROLE.
//I CAN CHECK THE ACCCESS POLICIES ONLY IF THE USER IS NOT LOGGED IN. //I CAN CHECK THE ACCCESS POLICIES IF AND ONLY IF THE USER IS NOT LOGGED IN.
if (user != null) { if (user == null) {
// CHECKING ACCESS POLICY // CHECKING ACCESS POLICY
LOG.info("Applying access policies for concessione " + mongoId + " returned by service"); LOG.info("Applying access policies for concessione " + mongoId + " returned by service");