Mercurial > dive4elements > river
changeset 2509:3952429cc41b
Added zoom listener a adjust the print link bbox.
flys-client/trunk@4364 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 09 May 2012 13:15:26 +0000 |
parents | 4aa70825bde1 |
children | 4861ab2c28d2 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java |
diffstat | 2 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Wed May 09 11:18:24 2012 +0000 +++ b/flys-client/ChangeLog Wed May 09 13:15:26 2012 +0000 @@ -1,3 +1,10 @@ +2012-05-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java: + Added zoom listener a adjust the print link bbox. Link bbox parameters + are generated correctly but the service does not respect them. Needs + debugging. + 2012-05-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java Wed May 09 11:18:24 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java Wed May 09 13:15:26 2012 +0000 @@ -25,6 +25,8 @@ import org.gwtopenmaps.openlayers.client.layer.Vector; import org.gwtopenmaps.openlayers.client.util.Attributes; +import org.gwtopenmaps.openlayers.client.event.MapZoomListener; + import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.client.ui.Toolbar; import de.intevation.flys.client.client.ui.ImgLink; @@ -36,8 +38,10 @@ /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ -public class MapToolbar extends Toolbar { - +public class MapToolbar +extends Toolbar +implements MapZoomListener +{ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); protected FloodMap floodMap; @@ -279,6 +283,8 @@ protected ImgLink createPrintMapLink() { String baseUrl = GWT.getHostPageBaseURL(); + getMap().addMapZoomListener(this); + return new ImgLink( baseUrl + MSG.downloadPDF(), getPrintUrl(), @@ -610,6 +616,11 @@ return epsgLabel; } + @Override + public void onMapZoom(MapZoomListener.MapZoomEvent e) { + printMapLink.setSource(getPrintUrl()); + } + public String getPrintUrl() { MapOutputTab ot = (MapOutputTab)getOutputTab(); Collection collection = ot.getCollection();