|
|
|
@ -3,14 +3,18 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
|
|
|
|
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.resources.Images;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
|
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
|
|
|
|
|
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Button;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.NavLink;
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
|
|
import com.google.gwt.event.shared.HandlerManager;
|
|
|
|
@ -18,6 +22,7 @@ import com.google.gwt.uibinder.client.UiBinder;
|
|
|
|
|
import com.google.gwt.uibinder.client.UiField;
|
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
|
|
|
import com.google.gwt.user.client.ui.Image;
|
|
|
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -61,6 +66,9 @@ public class GeonaDataViewMainPanel extends Composite {
|
|
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
|
Button extentToItaly;
|
|
|
|
|
|
|
|
|
|
@UiField
|
|
|
|
|
Button extentToEarth;
|
|
|
|
|
|
|
|
|
|
private MapPanel mapPanel;
|
|
|
|
|
|
|
|
|
@ -84,8 +92,18 @@ public class GeonaDataViewMainPanel extends Composite {
|
|
|
|
|
bindHandlers();
|
|
|
|
|
dataPointSelection.setIcon(IconType.SCREENSHOT);
|
|
|
|
|
dataBoxSelection.setIcon(IconType.BOOKMARK);
|
|
|
|
|
|
|
|
|
|
removeQuery.setIcon(IconType.REMOVE);
|
|
|
|
|
|
|
|
|
|
Image italyImg = new Image(Images.ICONS.italyIcon());
|
|
|
|
|
italyImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
|
|
|
|
|
extentToItaly.getElement().appendChild(italyImg.getElement());
|
|
|
|
|
extentToItaly.setWidth("140px");
|
|
|
|
|
|
|
|
|
|
Image worldImg = new Image(Images.ICONS.worldIcon());
|
|
|
|
|
worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
|
|
|
|
|
extentToEarth.getElement().appendChild(worldImg.getElement());
|
|
|
|
|
extentToEarth.setWidth("140px");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -161,7 +179,22 @@ public class GeonaDataViewMainPanel extends Composite {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
applicationBus.fireEvent(new MapExtentToEvent(ExtentMapUtil.getLocation(ExtentMapUtil.PLACE.ITALY)));
|
|
|
|
|
Location italyLocation = ExtentMapUtil.getLocation(ExtentMapUtil.PLACE.ITALY);
|
|
|
|
|
applicationBus.fireEvent(new MapExtentToEvent(italyLocation));
|
|
|
|
|
map.setCenter(italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857));
|
|
|
|
|
map.setZoom(italyLocation.getZoomLevel());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
extentToEarth.addClickHandler(new ClickHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(ClickEvent event) {
|
|
|
|
|
Location earthLocation = ExtentMapUtil.getLocation(ExtentMapUtil.PLACE.EARTH);
|
|
|
|
|
applicationBus.fireEvent(new MapExtentToEvent(earthLocation));
|
|
|
|
|
map.setCenter(earthLocation.getCoordinate(MAP_PROJECTION.EPSG_3857));
|
|
|
|
|
map.setZoom(earthLocation.getZoomLevel());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|