Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java @ 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 | 51ed89b754ae |
comparison
equal
deleted
inserted
replaced
2508:4aa70825bde1 | 2509:3952429cc41b |
---|---|
23 import org.gwtopenmaps.openlayers.client.control.ZoomBox; | 23 import org.gwtopenmaps.openlayers.client.control.ZoomBox; |
24 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; | 24 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
25 import org.gwtopenmaps.openlayers.client.layer.Vector; | 25 import org.gwtopenmaps.openlayers.client.layer.Vector; |
26 import org.gwtopenmaps.openlayers.client.util.Attributes; | 26 import org.gwtopenmaps.openlayers.client.util.Attributes; |
27 | 27 |
28 import org.gwtopenmaps.openlayers.client.event.MapZoomListener; | |
29 | |
28 import de.intevation.flys.client.client.FLYSConstants; | 30 import de.intevation.flys.client.client.FLYSConstants; |
29 import de.intevation.flys.client.client.ui.Toolbar; | 31 import de.intevation.flys.client.client.ui.Toolbar; |
30 import de.intevation.flys.client.client.ui.ImgLink; | 32 import de.intevation.flys.client.client.ui.ImgLink; |
31 import de.intevation.flys.client.client.utils.EnableDisableCmd; | 33 import de.intevation.flys.client.client.utils.EnableDisableCmd; |
32 import de.intevation.flys.client.shared.model.ThemeList; | 34 import de.intevation.flys.client.shared.model.ThemeList; |
34 | 36 |
35 | 37 |
36 /** | 38 /** |
37 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 39 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
38 */ | 40 */ |
39 public class MapToolbar extends Toolbar { | 41 public class MapToolbar |
40 | 42 extends Toolbar |
43 implements MapZoomListener | |
44 { | |
41 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); | 45 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
42 | 46 |
43 protected FloodMap floodMap; | 47 protected FloodMap floodMap; |
44 protected DragPan pan; | 48 protected DragPan pan; |
45 protected ZoomBox zoomBox; | 49 protected ZoomBox zoomBox; |
277 } | 281 } |
278 | 282 |
279 protected ImgLink createPrintMapLink() { | 283 protected ImgLink createPrintMapLink() { |
280 String baseUrl = GWT.getHostPageBaseURL(); | 284 String baseUrl = GWT.getHostPageBaseURL(); |
281 | 285 |
286 getMap().addMapZoomListener(this); | |
287 | |
282 return new ImgLink( | 288 return new ImgLink( |
283 baseUrl + MSG.downloadPDF(), | 289 baseUrl + MSG.downloadPDF(), |
284 getPrintUrl(), | 290 getPrintUrl(), |
285 20, 20, | 291 20, 20, |
286 true); | 292 true); |
608 epsgLabel.setWidth(75); | 614 epsgLabel.setWidth(75); |
609 | 615 |
610 return epsgLabel; | 616 return epsgLabel; |
611 } | 617 } |
612 | 618 |
619 @Override | |
620 public void onMapZoom(MapZoomListener.MapZoomEvent e) { | |
621 printMapLink.setSource(getPrintUrl()); | |
622 } | |
623 | |
613 public String getPrintUrl() { | 624 public String getPrintUrl() { |
614 MapOutputTab ot = (MapOutputTab)getOutputTab(); | 625 MapOutputTab ot = (MapOutputTab)getOutputTab(); |
615 Collection collection = ot.getCollection(); | 626 Collection collection = ot.getCollection(); |
616 String uuid = collection.identifier(); | 627 String uuid = collection.identifier(); |
617 | 628 |