fixed the Export Map as
This commit is contained in:
parent
c471f39d50
commit
ad71d45158
|
@ -40,7 +40,7 @@
|
|||
</b:Nav>
|
||||
<b:Nav>
|
||||
<b:Button type="LINK" ui:field="extentToEarth"
|
||||
text="Earth" title="Center to Earth"></b:Button>
|
||||
text="World" title="Center to World"></b:Button>
|
||||
</b:Nav>
|
||||
</b:DropdownButton>
|
||||
<b:DropdownButton type="LINK" text="Query"
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ConcessioneView extends Composite {
|
|||
Button shareButton;
|
||||
|
||||
@UiField
|
||||
Button viewButton;
|
||||
Button expandButton;
|
||||
|
||||
private ConcessioneDV concessioneDV;
|
||||
|
||||
|
@ -194,17 +194,17 @@ public class ConcessioneView extends Composite {
|
|||
}
|
||||
});
|
||||
|
||||
viewButton.setType(ButtonType.LINK);
|
||||
viewButton.setIcon(IconType.EXPAND);
|
||||
viewButton.setTitle("View Details in New Dialog");
|
||||
expandButton.setType(ButtonType.LINK);
|
||||
expandButton.setIcon(IconType.EXPAND);
|
||||
expandButton.setTitle("Show this view in new Window");
|
||||
|
||||
viewButton.addClickHandler(new ClickHandler() {
|
||||
expandButton.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
ConcessioneView cv = new ConcessioneView(geonaItemRef, concessioneDV, false, openImageButtonVisible);
|
||||
cv.setViewDetailsButtonVisible(false);
|
||||
cv.setExpandViewButtonVisible(false);
|
||||
int width = Window.getClientWidth()*75/100;
|
||||
int height = Window.getClientHeight()*70/100;
|
||||
ModalWindow mw = new ModalWindow(concessioneDV.getNome(), width, height);
|
||||
|
@ -352,8 +352,8 @@ public class ConcessioneView extends Composite {
|
|||
return concessioneDV;
|
||||
}
|
||||
|
||||
protected void setViewDetailsButtonVisible(boolean bool) {
|
||||
viewButton.setVisible(bool);
|
||||
protected void setExpandViewButtonVisible(boolean bool) {
|
||||
expandButton.setVisible(bool);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<g:HorizontalPanel
|
||||
addStyleNames="{style.margin-bottom-10}">
|
||||
<b:Button ui:field="shareButton">Share</b:Button>
|
||||
<b:Button ui:field="viewButton">View</b:Button>
|
||||
<b:Button ui:field="expandButton">Expand</b:Button>
|
||||
</g:HorizontalPanel>
|
||||
<b:Paragraph ui:field="introduzione"></b:Paragraph>
|
||||
<g:VerticalPanel addStyleNames="{style.width-100}">
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTabl
|
|||
import com.github.gwtbootstrap.client.ui.DropdownButton;
|
||||
import com.github.gwtbootstrap.client.ui.NavLink;
|
||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
|
@ -52,28 +53,29 @@ public class LayerConcessioneView extends Composite {
|
|||
initWidget(uiBinder.createAndBindUi(this));
|
||||
GWT.log("Showing: " + layerDV);
|
||||
|
||||
DropdownButton exportMapButton = new DropdownButton("Export Map as...");
|
||||
exportMapButton.setType(ButtonType.LINK);
|
||||
exportMapButton.setTitle("Export this map view (OSM + layer) as an image...");
|
||||
exportMapButton.setVisible(false);
|
||||
Style expButton = exportMapButton.getElement().getStyle();
|
||||
expButton.setMarginTop(2, Unit.PX);
|
||||
|
||||
GWT.log("WMS LINK: " + layerDV.getWmsLink());
|
||||
if (layerDV.getLayerName() != null && layerDV.getWmsLink() != null) {
|
||||
|
||||
DropdownButton exportMapButton = new DropdownButton("Export Map as...");
|
||||
exportMapButton.setType(ButtonType.LINK);
|
||||
exportMapButton.setIcon(IconType.DOWNLOAD_ALT);
|
||||
exportMapButton.setTitle("Export the map view (OSM + layer) as an image...");
|
||||
Style exportStyle = exportMapButton.getElement().getStyle();
|
||||
exportStyle.setWidth(100, Unit.PCT);
|
||||
exportStyle.setMarginLeft(70, Unit.PCT);
|
||||
|
||||
Location italyLocation = ExtentMapUtil.getLocation(PLACE.ITALY);
|
||||
Coordinate transformedCenterCoordinate = italyLocation.getCoordinate(MAP_PROJECTION.EPSG_3857);
|
||||
MapView mapView = new MapView(transformedCenterCoordinate,
|
||||
GeoportalDataViewerConstants.LIGHT_MAP_ITALY_FIT_ZOOM_ON, "70%", "300px");
|
||||
|
||||
exportMapButton.setVisible(true);
|
||||
mapViewPanel.add(exportMapButton);
|
||||
mapViewPanel.add(mapView);
|
||||
mapViewPanel.add(exportMapButton);
|
||||
String mapServerHost = layerDV.getWmsLink().contains("?")
|
||||
? layerDV.getWmsLink().substring(0, layerDV.getWmsLink().indexOf("?"))
|
||||
: layerDV.getWmsLink();
|
||||
|
||||
mapView.addWMSLayer(mapServerHost, layerDV.getLayerName(), layerDV.getBbox());
|
||||
|
||||
String htmlLinkId = mapView.getPanelMapElementId() + "-image-download";
|
||||
|
||||
|
@ -117,6 +119,8 @@ public class LayerConcessioneView extends Composite {
|
|||
exportMapButton.add(navLink);
|
||||
|
||||
}
|
||||
//mapViewPanel.add(exportMapButton);
|
||||
}
|
||||
|
||||
customTable.addNextKeyValue("Abstract", layerDV.getAbstractSection());
|
||||
customTable.addNextKeyValue("Valutazione qualità", layerDV.getValutazioneQualita());
|
||||
|
@ -124,9 +128,6 @@ public class LayerConcessioneView extends Composite {
|
|||
customTable.addNextKeyValue("Scala acquisizione dati", layerDV.getScalaAcquisizione());
|
||||
customTable.addNextKeyValues("Autori", layerDV.getAuthors(), GeoportalDataViewerConstants.NEW_LINE_BR);
|
||||
layerConcessionePanel.add(customTable);
|
||||
|
||||
mapView.addWMSLayer(mapServerHost, layerDV.getLayerName(), layerDV.getBbox());
|
||||
}
|
||||
}
|
||||
|
||||
public static native void exportPDF(String layerURL) /*-{
|
||||
|
|
Loading…
Reference in New Issue