|
|
|
@ -11,11 +11,16 @@ import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.IndexLayerDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
|
|
|
@ -462,19 +467,20 @@ public class LayerManager {
|
|
|
|
|
/**
|
|
|
|
|
* Adds the layer.
|
|
|
|
|
*
|
|
|
|
|
* @param lot the lot
|
|
|
|
|
* @param layerTitle the layer title
|
|
|
|
|
* @param layerName the layer name
|
|
|
|
|
* @param wmsLink the wms link
|
|
|
|
|
* @param isBase the is base
|
|
|
|
|
* @param displayInLayerSwitcher the display in layer switcher
|
|
|
|
|
* @param UUID the uuid
|
|
|
|
|
* @param asDetailLayer the as detail layer
|
|
|
|
|
* @param minResolution the min resolution
|
|
|
|
|
* @param maxResolution the max resolution
|
|
|
|
|
* @param profileID the profile ID
|
|
|
|
|
* @param projectID the project ID
|
|
|
|
|
* @param projectDV the project DV
|
|
|
|
|
* @param lot the lot
|
|
|
|
|
* @param layerTitle the layer title
|
|
|
|
|
* @param layerName the layer name
|
|
|
|
|
* @param wmsLink the wms link
|
|
|
|
|
* @param isBase the is base
|
|
|
|
|
* @param displayInLayerSwitcher the display in layer switcher
|
|
|
|
|
* @param UUID the uuid
|
|
|
|
|
* @param asDetailLayer the as detail layer
|
|
|
|
|
* @param minResolution the min resolution
|
|
|
|
|
* @param maxResolution the max resolution
|
|
|
|
|
* @param profileID the profile ID
|
|
|
|
|
* @param projectID the project ID
|
|
|
|
|
* @param projectDV the project DV
|
|
|
|
|
* @param notifyLayerAlreadyAdded the notify layer already added
|
|
|
|
|
*/
|
|
|
|
|
private void addLayer(final LayerObjectType lot, final String layerTitle, final String layerName,
|
|
|
|
|
final String wmsLink, final boolean isBase, final boolean displayInLayerSwitcher, final String UUID,
|
|
|
|
@ -563,6 +569,12 @@ public class LayerManager {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the CQL for layer to index layer.
|
|
|
|
|
*
|
|
|
|
|
* @param layerName the layer name
|
|
|
|
|
* @param cqlFilter the cql filter
|
|
|
|
|
*/
|
|
|
|
|
public void setCQLForLayerToIndexLayer(String layerName, String cqlFilter) {
|
|
|
|
|
LayerObject theLo = mapIndexLayerObjects.get(layerName);
|
|
|
|
|
if (theLo != null) {
|
|
|
|
@ -578,7 +590,6 @@ public class LayerManager {
|
|
|
|
|
*
|
|
|
|
|
* @param layer the layer
|
|
|
|
|
* @param profileID the profile ID
|
|
|
|
|
* @param projectDV the project DV
|
|
|
|
|
*/
|
|
|
|
|
public void addIndexLayer(IndexLayerDV layer, String profileID) {
|
|
|
|
|
GWT.log("Adding index layer: " + layer);
|
|
|
|
@ -589,6 +600,11 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes the index layer.
|
|
|
|
|
*
|
|
|
|
|
* @param layer the layer
|
|
|
|
|
*/
|
|
|
|
|
public void removeIndexLayer(IndexLayerDV layer) {
|
|
|
|
|
|
|
|
|
|
String wmsLink = layer.getLayer().getOgcLinks().get("wms");
|
|
|
|
@ -895,13 +911,215 @@ public class LayerManager {
|
|
|
|
|
/**
|
|
|
|
|
* Show popup info for centroid layer.
|
|
|
|
|
*
|
|
|
|
|
* @param projectView the project view
|
|
|
|
|
*/
|
|
|
|
|
public void showPopupInfoForCentroidLayer(ProjectView projectView) {
|
|
|
|
|
GWT.log("showPopupInfoForCentroidLayer for projectView: " + projectView);
|
|
|
|
|
|
|
|
|
|
FlexTable flex = new FlexTable();
|
|
|
|
|
flex.setCellPadding(1);
|
|
|
|
|
flex.setCellSpacing(1);
|
|
|
|
|
flex.getElement().addClassName("popup-table");
|
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
|
|
|
|
|
final ProjectDV projectDV = projectView.getTheProjectDV();
|
|
|
|
|
|
|
|
|
|
FlexTable intFlex = new FlexTable();
|
|
|
|
|
intFlex.setCellPadding(1);
|
|
|
|
|
intFlex.setCellSpacing(1);
|
|
|
|
|
if (projectDV.getTheDocument() != null) {
|
|
|
|
|
LinkedHashMap<String, Object> map = projectDV.getTheDocument().getDocumentAsMap();
|
|
|
|
|
// my-html-table
|
|
|
|
|
// intFlex.getElement().addClassName("my-html-table");
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (String key : map.keySet()) {
|
|
|
|
|
try {
|
|
|
|
|
Object theValue = map.get(key);
|
|
|
|
|
String toStringValue = theValue + "";
|
|
|
|
|
// intFlex.setHTML(i, 0, key);
|
|
|
|
|
intFlex.setHTML(intFlex.getRowCount() + 1, 0, "<span title='" + toStringValue + "'>"
|
|
|
|
|
+ StringUtil.ellipsize(toStringValue, 100) + "</span>");
|
|
|
|
|
i++;
|
|
|
|
|
// showing the first two fields returned into document
|
|
|
|
|
if (i == 2)
|
|
|
|
|
break;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, intFlex.getElement().getString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TemporalReferenceDV tempRef = projectDV.getTemporalReference();
|
|
|
|
|
if (tempRef != null) {
|
|
|
|
|
|
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, ProjectUtil.toHTMLCode(tempRef));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<SectionView> selections = projectView.getListSections();
|
|
|
|
|
|
|
|
|
|
boolean firstImageFound = false;
|
|
|
|
|
for (SectionView sectionView : selections) {
|
|
|
|
|
List<SubDocumentView> subDocuments = sectionView.getListSubDocuments();
|
|
|
|
|
for (SubDocumentView subDoc : subDocuments) {
|
|
|
|
|
List<FilesetDV> images = subDoc.getListImages();
|
|
|
|
|
if (images != null && images.size() > 0) {
|
|
|
|
|
for (FilesetDV fileset : images) {
|
|
|
|
|
List<PayloadDV> payloads = fileset.getListPayload();
|
|
|
|
|
if (payloads != null && payloads.size() > 0) {
|
|
|
|
|
PayloadDV img = payloads.get(0);
|
|
|
|
|
if (img != null && img.getLink() != null) {
|
|
|
|
|
String theImgHTML = "<img src=\"" + img.getLink() + "\"></img>";
|
|
|
|
|
GWT.log("theImgHTML: " + theImgHTML);
|
|
|
|
|
flex.setHTML(flex.getRowCount() + 1, 0, theImgHTML);
|
|
|
|
|
firstImageFound = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (firstImageFound)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (firstImageFound)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Button buttonOpenDtl = new Button("Open Details");
|
|
|
|
|
buttonOpenDtl.getElement().setId("open-details");
|
|
|
|
|
buttonOpenDtl.setType(ButtonType.LINK);
|
|
|
|
|
|
|
|
|
|
buttonOpenDtl.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
GWT.log("Open Details clicked");
|
|
|
|
|
ShowDetailsEvent toEvent = new ShowDetailsEvent(LayerObjectType.INDEX_LAYER.name(),
|
|
|
|
|
projectDV.getProfileID(), projectDV.getId(), null, true, EVENT_SOURCE.OPEN_DETAILS);
|
|
|
|
|
applicationBus.fireEvent(toEvent);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final Button buttonViewLayers = new Button("Zoom to Layers");
|
|
|
|
|
buttonViewLayers.getElement().setId("go-to-layers");
|
|
|
|
|
buttonViewLayers.getElement().setTitle("Zoom to Layers");
|
|
|
|
|
buttonViewLayers.setType(ButtonType.LINK);
|
|
|
|
|
|
|
|
|
|
if (olMap.getCurrentZoomLevel() >= OLMapManager.LAYER_DETAIL_MAX_RESOLUTION) {
|
|
|
|
|
buttonViewLayers.setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buttonViewLayers.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
GWT.log("View Layers clicked");
|
|
|
|
|
fireGoToLayers();
|
|
|
|
|
buttonViewLayers.setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
FlowPanel flow = new FlowPanel();
|
|
|
|
|
flow.add(buttonOpenDtl);
|
|
|
|
|
flow.add(buttonViewLayers);
|
|
|
|
|
vpPanel.add(flow);
|
|
|
|
|
|
|
|
|
|
Coordinate positionTo = null;
|
|
|
|
|
|
|
|
|
|
GeoJSON spatialReference = projectDV.getSpatialReference();
|
|
|
|
|
if (spatialReference == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
ExtentWrapped ew = new ExtentWrapped(spatialReference.getBbox().getMinX(),
|
|
|
|
|
spatialReference.getBbox().getMinY(), spatialReference.getBbox().getMaxX(),
|
|
|
|
|
spatialReference.getBbox().getMaxY());
|
|
|
|
|
|
|
|
|
|
positionTo = MapUtils.transformCoordiante(ew.getCenter(), MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
GWT.log("Error on calculating center of the extent " + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fallback
|
|
|
|
|
if (positionTo == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
final Coordinate centerTo = positionTo;
|
|
|
|
|
new Timer() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
olMap.showPopup(vpPanel.toString(), centerTo);
|
|
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute() {
|
|
|
|
|
Element buttonElement = DOM.getElementById("open-details");
|
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
|
|
|
|
|
|
ShowDetailsEvent toEvent = new ShowDetailsEvent(LayerObjectType.INDEX_LAYER.name(),
|
|
|
|
|
projectDV.getProfileID(), projectDV.getId(), null, true,
|
|
|
|
|
EVENT_SOURCE.OPEN_DETAILS);
|
|
|
|
|
applicationBus.fireEvent(toEvent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute() {
|
|
|
|
|
Element buttonElement = DOM.getElementById("go-to-layers");
|
|
|
|
|
Event.sinkEvents(buttonElement, Event.ONCLICK);
|
|
|
|
|
Event.setEventListener(buttonElement, new EventListener() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
|
// buttonElement.setAttribute("visible", "none");
|
|
|
|
|
// buttonElement.getStyle().setVisibility(Visibility.HIDDEN);
|
|
|
|
|
fireGoToLayers();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}.schedule(OpenLayerMap.SET_CENTER_ANIMATED_DURATION + 100);
|
|
|
|
|
|
|
|
|
|
olMap.setCenter(centerTo);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show popup info for centroid layer after clicking on map
|
|
|
|
|
*
|
|
|
|
|
* @param geoNaDataObject the geo na data object
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
* @param onFailureCenterTo the on failure center to
|
|
|
|
|
*/
|
|
|
|
|
public void showPopupInfoForCentroidLayer(GeoNaSpatialQueryResult geoNaDataObject, FeatureRow feature,
|
|
|
|
|
Coordinate onFailureCenterTo) {
|
|
|
|
|
|
|
|
|
|
GWT.log("showPopupInfoForCentroidLayer showing feature: " + feature);
|
|
|
|
|
GWT.log("showPopupInfoForCentroidLayer showing layerObject: " + geoNaDataObject.getSourceLayerObject());
|
|
|
|
|
|
|
|
|
@ -912,12 +1130,6 @@ public class LayerManager {
|
|
|
|
|
VerticalPanel vpPanel = new VerticalPanel();
|
|
|
|
|
vpPanel.add(flex);
|
|
|
|
|
|
|
|
|
|
if (feature == null) {
|
|
|
|
|
flex.setHTML(0, 0, new HTML("No data available").toString());
|
|
|
|
|
olMap.showPopup(vpPanel.toString(), onFailureCenterTo);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProjectDV projectDV = geoNaDataObject.getSourceLayerObject().getProjectDV();
|
|
|
|
|
|
|
|
|
|
if (projectDV != null) {
|
|
|
|
@ -953,9 +1165,6 @@ public class LayerManager {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Showing properties belonging to centroid layer, ignoring this
|
|
|
|
|
// Map<String, List<String>> entries = feature.getMapProperties();
|
|
|
|
|
|
|
|
|
|
if (geoNaDataObject.getMapImages() != null) {
|
|
|
|
|
for (String key : geoNaDataObject.getMapImages().keySet()) {
|
|
|
|
|
List<PayloadDV> listUI = geoNaDataObject.getMapImages().get(key);
|
|
|
|
@ -974,7 +1183,6 @@ public class LayerManager {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GWT.log("The selected Feature is: " + feature);
|
|
|
|
|
// GeoportalDataViewerConstants.print("The selected Feature is: "+feature);
|
|
|
|
|
FeatureRow theFeature = feature;
|
|
|
|
|
Button buttonOpenDtl = new Button("Open Details");
|
|
|
|
|
buttonOpenDtl.getElement().setId("open-details");
|
|
|
|
@ -985,8 +1193,6 @@ public class LayerManager {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
GWT.log("Open Details clicked");
|
|
|
|
|
// ShowDetailsEvent toEvent = parseGeonaReferences(geoNaDataObject.getSourceLayerObject(), theFeature);
|
|
|
|
|
// applicationBus.fireEvent(toEvent);
|
|
|
|
|
fireOpenDetails(geoNaDataObject.getSourceLayerObject(), theFeature);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1017,53 +1223,60 @@ public class LayerManager {
|
|
|
|
|
vpPanel.add(flow);
|
|
|
|
|
|
|
|
|
|
Coordinate positionTo = null;
|
|
|
|
|
GWT.log("geometry is: " + feature.getGeometry());
|
|
|
|
|
if (feature.getGeometry() != null) {
|
|
|
|
|
GWT.log("trasforming geometry: " + feature.getGeometry().getToJSONObject());
|
|
|
|
|
|
|
|
|
|
Geometry geom = new GeoJson().readGeometry(feature.getGeometry().getToJSONObject(), null);
|
|
|
|
|
|
|
|
|
|
// POINT
|
|
|
|
|
if (geom.getType().equalsIgnoreCase("Point")) {
|
|
|
|
|
GWT.log("geometry: is a point");
|
|
|
|
|
String coordinateJSON = feature.getGeometry().getCoordinatesJSON();
|
|
|
|
|
JSONArray centerJSON = (JSONArray) JSONParser.parseStrict(coordinateJSON);
|
|
|
|
|
// Coordinate center = OLFactory.createCoordinate(
|
|
|
|
|
// new Double(centerJSON.get(0).toString()),
|
|
|
|
|
// new Double(centerJSON.get(1).toString()));
|
|
|
|
|
if (feature == null) {
|
|
|
|
|
positionTo = onFailureCenterTo;
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
Coordinate center = new Coordinate(new Double(centerJSON.get(0).toString()),
|
|
|
|
|
new Double(centerJSON.get(1).toString()));
|
|
|
|
|
GWT.log("geometry is: " + feature.getGeometry());
|
|
|
|
|
if (feature.getGeometry() != null) {
|
|
|
|
|
GWT.log("trasforming geometry: " + feature.getGeometry().getToJSONObject());
|
|
|
|
|
|
|
|
|
|
if (feature.getCrsName() != null && feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
Geometry geom = new GeoJson().readGeometry(feature.getGeometry().getToJSONObject(), null);
|
|
|
|
|
|
|
|
|
|
center = MapUtils.transformCoordiante(center, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
}
|
|
|
|
|
positionTo = center;
|
|
|
|
|
} else {
|
|
|
|
|
// POINT
|
|
|
|
|
if (geom.getType().equalsIgnoreCase("Point")) {
|
|
|
|
|
GWT.log("geometry: is a point");
|
|
|
|
|
String coordinateJSON = feature.getGeometry().getCoordinatesJSON();
|
|
|
|
|
JSONArray centerJSON = (JSONArray) JSONParser.parseStrict(coordinateJSON);
|
|
|
|
|
|
|
|
|
|
Extent geomExtent = geom.getExtent();
|
|
|
|
|
Coordinate center = new Coordinate(new Double(centerJSON.get(0).toString()),
|
|
|
|
|
new Double(centerJSON.get(1).toString()));
|
|
|
|
|
|
|
|
|
|
Coordinate lower = OLFactory.createCoordinate(geomExtent.getLowerLeftX(), geomExtent.getLowerLeftY());
|
|
|
|
|
Coordinate upper = OLFactory.createCoordinate(geomExtent.getUpperRightX(), geomExtent.getUpperRightY());
|
|
|
|
|
Coordinate lowerCoord = lower;
|
|
|
|
|
Coordinate upperCoord = upper;
|
|
|
|
|
if (feature.getCrsName() != null && feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
if (feature.getCrsName() != null
|
|
|
|
|
&& feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
|
|
|
|
|
lowerCoord = MapUtils.transformCoordiante(lower, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
upperCoord = MapUtils.transformCoordiante(upper, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
}
|
|
|
|
|
center = MapUtils.transformCoordiante(center, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
}
|
|
|
|
|
positionTo = center;
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
Extent geomExtent = geom.getExtent();
|
|
|
|
|
|
|
|
|
|
Coordinate lower = OLFactory.createCoordinate(geomExtent.getLowerLeftX(),
|
|
|
|
|
geomExtent.getLowerLeftY());
|
|
|
|
|
Coordinate upper = OLFactory.createCoordinate(geomExtent.getUpperRightX(),
|
|
|
|
|
geomExtent.getUpperRightY());
|
|
|
|
|
Coordinate lowerCoord = lower;
|
|
|
|
|
Coordinate upperCoord = upper;
|
|
|
|
|
if (feature.getCrsName() != null
|
|
|
|
|
&& feature.getCrsName().endsWith(MAP_PROJECTION.EPSG_4326.getId())) {
|
|
|
|
|
|
|
|
|
|
lowerCoord = MapUtils.transformCoordiante(lower, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
upperCoord = MapUtils.transformCoordiante(upper, MAP_PROJECTION.EPSG_4326.getName(),
|
|
|
|
|
MAP_PROJECTION.EPSG_3857.getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExtentWrapped ew = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(),
|
|
|
|
|
upperCoord.getY());
|
|
|
|
|
ExtentWrapped ew = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(),
|
|
|
|
|
upperCoord.getY());
|
|
|
|
|
|
|
|
|
|
positionTo = new Coordinate(ew.getCenter().getX(), ew.getCenter().getY());
|
|
|
|
|
positionTo = new Coordinate(ew.getCenter().getX(), ew.getCenter().getY());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
GWT.log("positionTo is: " + positionTo);
|
|
|
|
|
}
|
|
|
|
|
GWT.log("positionTo is: " + positionTo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fallback
|
|
|
|
@ -1088,10 +1301,6 @@ public class LayerManager {
|
|
|
|
|
@Override
|
|
|
|
|
public void onBrowserEvent(Event event) {
|
|
|
|
|
if (Event.ONCLICK == event.getTypeInt()) {
|
|
|
|
|
// ShowDetailsEvent toEvent = parseGeonaReferences(
|
|
|
|
|
// geoNaDataObject.getSourceLayerObject(), theFeature);
|
|
|
|
|
// applicationBus.fireEvent(toEvent);
|
|
|
|
|
|
|
|
|
|
fireOpenDetails(geoNaDataObject.getSourceLayerObject(), theFeature);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1130,6 +1339,9 @@ public class LayerManager {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fire go to layers.
|
|
|
|
|
*/
|
|
|
|
|
protected void fireGoToLayers() {
|
|
|
|
|
int zoomValue = (int) (OLMapManager.LAYER_DETAIL_MAX_RESOLUTION + 1);
|
|
|
|
|
olMap.setZoom(zoomValue);
|
|
|
|
@ -1141,6 +1353,12 @@ public class LayerManager {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fire open details.
|
|
|
|
|
*
|
|
|
|
|
* @param layerObject the layer object
|
|
|
|
|
* @param theFeature the the feature
|
|
|
|
|
*/
|
|
|
|
|
protected void fireOpenDetails(LayerObject layerObject, FeatureRow theFeature) {
|
|
|
|
|
ShowDetailsEvent toEvent = parseGeonaReferences(layerObject, theFeature);
|
|
|
|
|
applicationBus.fireEvent(toEvent);
|
|
|
|
|