task_25066 #15
|
@ -28,8 +28,8 @@ public class LayerOrder {
|
||||||
|
|
||||||
LAYER_OFFSET.put(LAYER_TYPE.BASE_MAP, 0); //Base OL or MapBox
|
LAYER_OFFSET.put(LAYER_TYPE.BASE_MAP, 0); //Base OL or MapBox
|
||||||
LAYER_OFFSET.put(LAYER_TYPE.CUSTOM_WMS_DETAIL, 70); //WMS custom Overlay. Es. Layer "Limiti Amministrativi"
|
LAYER_OFFSET.put(LAYER_TYPE.CUSTOM_WMS_DETAIL, 70); //WMS custom Overlay. Es. Layer "Limiti Amministrativi"
|
||||||
LAYER_OFFSET.put(LAYER_TYPE.BASE_WMS, 140); // Index layers (i.e. centroids for UCD)
|
LAYER_OFFSET.put(LAYER_TYPE.BASE_WMS, 210); // Index layers (i.e. centroids for UCD)
|
||||||
LAYER_OFFSET.put(LAYER_TYPE.WMS_DETAIL, 210); //Layer/s belonging to a Project (materialized layers. Ex. "Posizionamento Scavo")
|
LAYER_OFFSET.put(LAYER_TYPE.WMS_DETAIL, 140); //Layer/s belonging to a Project (materialized layers. Ex. "Posizionamento Scavo")
|
||||||
LAYER_OFFSET.put(LAYER_TYPE.VECTOR, 320); //Vector layer to show other info. Ex. Pointer with coordinates (x,y) in the Light OL Map.
|
LAYER_OFFSET.put(LAYER_TYPE.VECTOR, 320); //Vector layer to show other info. Ex. Pointer with coordinates (x,y) in the Light OL Map.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ public abstract class OpenLayerMap {
|
||||||
public void fitToExtent(ol.Extent extent) {
|
public void fitToExtent(ol.Extent extent) {
|
||||||
ViewFitOptions opt = new ViewFitOptions();
|
ViewFitOptions opt = new ViewFitOptions();
|
||||||
opt.setMaxZoom(16);
|
opt.setMaxZoom(16);
|
||||||
opt.setDuration(SET_CENTER_ANIMATED_DURATION*4);
|
opt.setDuration(SET_CENTER_ANIMATED_DURATION*5);
|
||||||
map.getView().fit(extent, opt);
|
map.getView().fit(extent, opt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,14 +210,6 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
navListSearch.getElement().getFirstChildElement().setAttribute("disabled", "disabled");
|
navListSearch.getElement().getFirstChildElement().setAttribute("disabled", "disabled");
|
||||||
|
|
||||||
// List<UseCaseDescriptorDV> listUCDs = new ArrayList<UseCaseDescriptorDV>();
|
|
||||||
//
|
|
||||||
// for (ItemFieldsResponse itemFieldsResponse : itemFieldsReponse) {
|
|
||||||
// listUCDs.add(itemFieldsResponse.getUseCaseDescriptorDV());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Collections.sort(listUCDs);
|
|
||||||
|
|
||||||
for (final ItemFieldsResponse itemFieldResp : itemFieldsReponse) {
|
for (final ItemFieldsResponse itemFieldResp : itemFieldsReponse) {
|
||||||
|
|
||||||
UseCaseDescriptorDV ucd = itemFieldResp.getUseCaseDescriptorDV();
|
UseCaseDescriptorDV ucd = itemFieldResp.getUseCaseDescriptorDV();
|
||||||
|
@ -282,7 +274,9 @@ public class GeonaDataViewMainPanel extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
searchFacilityPanel.getElement().getParentElement().getStyle().setOpacity(0.9);
|
searchFacilityPanel.getElement().getParentElement().addClassName("opacity-09");
|
||||||
|
panelCustomOverlayLayers.getElement().getParentElement().addClassName("opacity-09");
|
||||||
|
panelCrossFilteringLayers.getElement().getParentElement().addClassName("opacity-09");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,10 +43,6 @@ import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.http.client.URL;
|
import com.google.gwt.http.client.URL;
|
||||||
import com.google.gwt.json.client.JSONArray;
|
|
||||||
import com.google.gwt.json.client.JSONObject;
|
|
||||||
import com.google.gwt.json.client.JSONParser;
|
|
||||||
import com.google.gwt.json.client.JSONValue;
|
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
@ -57,10 +53,9 @@ import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
import jsinterop.base.JsPropertyMap;
|
import jsinterop.base.JsPropertyMap;
|
||||||
import ol.Coordinate;
|
|
||||||
import ol.Extent;
|
import ol.Extent;
|
||||||
import ol.Feature;
|
import ol.Feature;
|
||||||
import ol.OLFactory;
|
import ol.source.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class CrossFilteringLayerPanel.
|
* The Class CrossFilteringLayerPanel.
|
||||||
|
@ -71,6 +66,8 @@ import ol.OLFactory;
|
||||||
*/
|
*/
|
||||||
public class CrossFilteringLayerPanel extends Composite {
|
public class CrossFilteringLayerPanel extends Composite {
|
||||||
|
|
||||||
|
private static final double BBOX_OFFESET_ON_FEATURES = 18000.0;
|
||||||
|
|
||||||
private static final String ITEM_LABEL = "centroid";
|
private static final String ITEM_LABEL = "centroid";
|
||||||
|
|
||||||
public static String COLORSCALERANGE = "COLORSCALERANGE";
|
public static String COLORSCALERANGE = "COLORSCALERANGE";
|
||||||
|
@ -473,19 +470,19 @@ public class CrossFilteringLayerPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String response) {
|
public void onSuccess(String response) {
|
||||||
Feature[] features = OLGeoJSONUtil.readGeoJsonFeatures(MAP_PROJECTION.EPSG_4326, response);
|
Feature[] features = OLGeoJSONUtil.readGeoJsonFeatures(MAP_PROJECTION.EPSG_4326, response);
|
||||||
|
|
||||||
if (features != null) {
|
if (features != null) {
|
||||||
int dataCount = features.length;
|
int dataCount = features.length;
|
||||||
|
|
||||||
panelResults.clear();
|
panelResults.clear();
|
||||||
panelResults.add(new HTML("<hr>"));
|
panelResults.add(new HTML("<hr>"));
|
||||||
|
|
||||||
FlexTable flexTable = new FlexTable();
|
FlexTable flexTable = new FlexTable();
|
||||||
|
|
||||||
String message = "";
|
String message = "";
|
||||||
|
|
||||||
if (dataCount <= 0) {
|
if (dataCount <= 0) {
|
||||||
message = "No "+ITEM_LABEL+" found";
|
message = "No " + ITEM_LABEL + " found";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
message = "Found " + dataCount;
|
message = "Found " + dataCount;
|
||||||
|
@ -496,53 +493,46 @@ public class CrossFilteringLayerPanel extends Composite {
|
||||||
resultMessage.setHTML(message);
|
resultMessage.setHTML(message);
|
||||||
flexTable.setWidget(0, 0, resultMessage.asWidget());
|
flexTable.setWidget(0, 0, resultMessage.asWidget());
|
||||||
panelResults.add(flexTable);
|
panelResults.add(flexTable);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONObject jObject = (JSONObject) JSONParser.parseStrict(response);
|
if (features.length > 0) {
|
||||||
JSONArray bbox = (JSONArray) jObject.get("bbox");
|
// Calculating Extend of the selected Features
|
||||||
double[] coords = new double[bbox.size()];
|
Vector vector = new Vector();
|
||||||
for (int i = 0; i < bbox.size(); i++) {
|
vector.addFeatures(features);
|
||||||
JSONValue coord = bbox.get(i);
|
Extent theExtent = vector.getExtent();
|
||||||
coords[i] = Double.parseDouble(coord.toString());
|
GWT.log("Extent from features is: " + theExtent);
|
||||||
}
|
theExtent = MapUtils.transformExtent(theExtent, MAP_PROJECTION.EPSG_4326.getName(),
|
||||||
|
MAP_PROJECTION.EPSG_3857.getName());
|
||||||
//Inverting coordinate to lat/long for EPSG:3857 Pseudo-Mercator
|
|
||||||
Coordinate lower = OLFactory.createCoordinate(coords[1], coords[0]);
|
|
||||||
Coordinate lowerCoord = MapUtils.transformCoordiante(lower, MAP_PROJECTION.EPSG_4326.getName(),
|
|
||||||
MAP_PROJECTION.EPSG_3857.getName());
|
|
||||||
|
|
||||||
Coordinate upper = OLFactory.createCoordinate(coords[3], coords[2]);
|
|
||||||
Coordinate upperCoord = MapUtils.transformCoordiante(upper, MAP_PROJECTION.EPSG_4326.getName(),
|
|
||||||
MAP_PROJECTION.EPSG_3857.getName());
|
|
||||||
|
|
||||||
final Extent transfExtent = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(), upperCoord.getY());
|
|
||||||
GWT.log("Zoom to selected - transf extent: "+transfExtent);
|
|
||||||
|
|
||||||
|
|
||||||
Button selectTo = new Button("Zoom to selected");
|
|
||||||
selectTo.setType(ButtonType.DEFAULT);
|
|
||||||
selectTo.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
double bboxOffset = features.length>1?BBOX_OFFESET_ON_FEATURES:0;
|
||||||
public void onClick(ClickEvent event) {
|
|
||||||
applicationBus.fireEvent(new FitMapToExtentEvent(transfExtent));
|
final Extent transfExtent = new ExtentWrapped(theExtent.getLowerLeftX() - bboxOffset,
|
||||||
|
theExtent.getLowerLeftY() - bboxOffset, theExtent.getUpperRightX() + bboxOffset,
|
||||||
}
|
theExtent.getUpperRightY() + bboxOffset);
|
||||||
});
|
GWT.log("Zoom to selected - transf extent: " + transfExtent);
|
||||||
flexTable.setWidget(1,0,selectTo);
|
|
||||||
//panelResults.add(selectTo);
|
Button selectTo = new Button("Zoom to selected");
|
||||||
|
selectTo.setTitle("Zoom to select centroids...");
|
||||||
}catch (Exception e) {
|
selectTo.setType(ButtonType.DEFAULT);
|
||||||
|
selectTo.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
applicationBus.fireEvent(new FitMapToExtentEvent(transfExtent));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
flexTable.setWidget(1, 0, selectTo);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final BBOXDV fromGeoJSON(double[] coords) {
|
public static final BBOXDV fromGeoJSON(double[] coords) {
|
||||||
BBOXDV toReturn = new BBOXDV();
|
BBOXDV toReturn = new BBOXDV();
|
||||||
toReturn.setMaxX(coords[0]);
|
toReturn.setMaxX(coords[0]);
|
||||||
|
@ -561,7 +551,6 @@ public class CrossFilteringLayerPanel extends Composite {
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load inner level.
|
* Load inner level.
|
||||||
*
|
*
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -892,4 +892,8 @@ RESPONSIVE
|
||||||
.filter-panel-style label {
|
.filter-panel-style label {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
/* END CUSTOM OVERLAY UI */
|
||||||
|
|
||||||
|
.opacity-09 {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue