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