bug fixing data point selection
This commit is contained in:
parent
9158437b2f
commit
a2131b7bf1
|
@ -63,9 +63,6 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="geoportal-data-common-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
GWT.log("X: "+x +", Y:"+y);
|
||||
if(x!=null && y!=null) {
|
||||
Coordinate transfCoord = MapUtils.transformCoordiante(new Coordinate(x, y), GeoportalDataViewerConstants.EPSG_4326, GeoportalDataViewerConstants.EPSG_3857);
|
||||
GeoQuery select = olMapMng.toDataPointQuery(transfCoord);
|
||||
GeoQuery select = olMapMng.toDataPointQuery(transfCoord,false);
|
||||
GWT.log("GeoQuery: "+select);
|
||||
//GeoportalDataViewerConstants.print("fireEvent QueryDataEvent");
|
||||
layerManager.getLayerManagerBus().fireEvent(new QueryDataEvent(select, transfCoord, record.getItemId(), true));
|
||||
|
|
|
@ -155,6 +155,7 @@ public class LayerManager {
|
|||
@Override
|
||||
public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
|
||||
|
||||
GWT.log("GeoNaDataObject's is/are " + listGeonaDataObjects.size());
|
||||
GWT.log("GeoNaDataObject's: " + listGeonaDataObjects);
|
||||
// GeoportalDataViewerConstants.print("GeoNaDataObject's:
|
||||
// "+listGeonaDataObjects);
|
||||
|
|
|
@ -65,7 +65,7 @@ public class OLMapManager {
|
|||
//
|
||||
// }
|
||||
|
||||
GeoQuery select = toDataPointQuery(coordinate);
|
||||
GeoQuery select = toDataPointQuery(coordinate,true);
|
||||
layerManagerBus.fireEvent(new QueryDataEvent(select, coordinate, null, true));
|
||||
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ public class OLMapManager {
|
|||
* @param coordinate the coordinate
|
||||
* @return the geo query
|
||||
*/
|
||||
public GeoQuery toDataPointQuery(Coordinate coordinate) {
|
||||
public GeoQuery toDataPointQuery(Coordinate coordinate, boolean manualClick) {
|
||||
|
||||
double lon = coordinate.getX();
|
||||
double lat = coordinate.getY();
|
||||
|
@ -149,7 +149,17 @@ public class OLMapManager {
|
|||
// ratio - mapPixelWeight : bboxWeight = 20px : geoRectangleWidth
|
||||
// where 10px is the pixel diameter dimension of the clicked point
|
||||
double bboxWidth = Math.abs(olMap.getExtent().getLowerLeftX() - olMap.getExtent().getUpperRightX());
|
||||
double geoWidth = (bboxWidth / w) * (20 / 2);
|
||||
double geoWidth = 0;
|
||||
//adding a tolerance in case of manual click
|
||||
if(manualClick) {
|
||||
//adding a tolerance for clicking
|
||||
geoWidth = (bboxWidth / w) * (14 / 2);
|
||||
}
|
||||
else {
|
||||
//data point selection for coordinate loaded from concessione
|
||||
geoWidth = (bboxWidth / w) * (2);
|
||||
}
|
||||
|
||||
double x1 = Math.min(lon + geoWidth, lon - geoWidth);
|
||||
double x2 = Math.max(lon + geoWidth, lon - geoWidth);
|
||||
double y1 = Math.min(lat + geoWidth, lat - geoWidth);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer;
|
||||
|
||||
import org.gcube.application.geoportal.client.legacy.ConcessioniManager;
|
||||
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
|
||||
|
||||
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
|
||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||
|
@ -16,20 +18,21 @@ public class GetConcessione {
|
|||
private static final String YOUR_TOKEN = "";
|
||||
|
||||
public static String SCOPE = "/gcube/devsec/devVRE";
|
||||
public static long concessioneId = 8;
|
||||
public static String concessioneId = "6102c07002ad3d05b5f81ddc";
|
||||
|
||||
public static ConcessioneDV getConcessioneForId(Long id) throws Exception{
|
||||
LOG.info("getConcessioneForId "+id+ "called");
|
||||
public static ConcessioneDV getConcessioneForId(String mongoID) throws Exception{
|
||||
LOG.info("getConcessioneForId "+mongoID+ "called");
|
||||
|
||||
ConcessioneDV concessionDV = null;
|
||||
|
||||
if(id==null)
|
||||
if(mongoID==null)
|
||||
throw new Exception("Invalid parameter. The Id is null");
|
||||
|
||||
try {
|
||||
LOG.info("Trying to get record for id "+id);
|
||||
Concessione concessione = new ConcessioniManager().getById(id+"");
|
||||
LOG.info("For id "+id+", got concessione "+concessione);
|
||||
LOG.info("Trying to get record for id "+mongoID);
|
||||
ConcessioniManagerI concessioniManager = statefulMongoConcessioni().build();
|
||||
Concessione concessione = concessioniManager.getById(mongoID);
|
||||
LOG.info("For id "+mongoID+", got concessione "+concessione);
|
||||
LOG.info("Immagini Rappresentative are: "+concessione.getImmaginiRappresentative());
|
||||
LOG.info("Relazione scavo: "+concessione.getRelazioneScavo());
|
||||
LOG.info("Pianta Fine scavo: "+concessione.getPianteFineScavo());
|
||||
|
@ -45,7 +48,7 @@ public class GetConcessione {
|
|||
return concessionDV;
|
||||
|
||||
}catch (Exception e) {
|
||||
String erroMsg = Concessione.class.getSimpleName() +" with id "+id+" not available";
|
||||
String erroMsg = Concessione.class.getSimpleName() +" with id "+mongoID+" not available";
|
||||
LOG.error(erroMsg,e);
|
||||
throw new Exception(erroMsg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue