Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapOutputTab.java @ 9561:5397555d74c9
MapOutputTab fix
author | gernotbelger |
---|---|
date | Thu, 25 Oct 2018 17:00:58 +0200 |
parents | 992c188b7330 |
children |
comparison
equal
deleted
inserted
replaced
9560:a39ae474f8d5 | 9561:5397555d74c9 |
---|---|
95 protected Canvas mapPanelCanvas; | 95 protected Canvas mapPanelCanvas; |
96 protected VLayout rootLayout = new VLayout(); | 96 protected VLayout rootLayout = new VLayout(); |
97 protected AbsolutePanel absPan = new AbsolutePanel(); | 97 protected AbsolutePanel absPan = new AbsolutePanel(); |
98 protected FloodMap floodMap; | 98 protected FloodMap floodMap; |
99 | 99 |
100 private boolean cancel = false; | |
101 | |
100 private final java.util.Map<String, String> wmsUrls = new HashMap<String, String>(); | 102 private final java.util.Map<String, String> wmsUrls = new HashMap<String, String>(); |
101 | 103 |
102 public MapOutputTab(final String title, final Collection collection, final OutputMode mode, final CollectionView collectionView) { | 104 public MapOutputTab(final String title, final Collection collection, final OutputMode mode, final CollectionView collectionView) { |
103 super(title, collection, collectionView, mode); | 105 super(title, collection, collectionView, mode); |
104 | 106 |
112 | 114 |
113 @Override | 115 @Override |
114 public void onSuccess(final MapConfig c) { | 116 public void onSuccess(final MapConfig c) { |
115 GWT.log("MAP SUCCESS!"); | 117 GWT.log("MAP SUCCESS!"); |
116 | 118 |
117 final Bounds max = boundsFromString(c.getMaxExtent()); | 119 if (!MapOutputTab.this.cancel) { |
118 Bounds initial = boundsFromString(c.getInitialExtent()); | 120 final Bounds max = boundsFromString(c.getMaxExtent()); |
119 | 121 Bounds initial = boundsFromString(c.getInitialExtent()); |
120 if (initial == null) { | 122 |
121 GWT.log("Warning: No initial extent set."); | 123 if (initial == null) { |
122 initial = max; | 124 GWT.log("Warning: No initial extent set."); |
125 initial = max; | |
126 } | |
127 | |
128 setFloodmap(new FloodMap(c.getSrid(), max, 640, 480)); | |
129 | |
130 initLayout(); | |
131 | |
132 initBarriers(); | |
133 | |
134 GWT.log("MAX EXTENT: " + max); | |
135 GWT.log("ZOOM TO: " + initial); | |
136 getMap().zoomToExtent(initial); | |
123 } | 137 } |
124 | 138 } |
125 setFloodmap(new FloodMap(c.getSrid(), max, 640, 480)); | 139 }); |
126 | 140 } |
127 initLayout(); | 141 |
128 initBarriers(); | 142 public void cancelMapService() { |
129 | 143 |
130 GWT.log("MAX EXTENT: " + max); | 144 this.cancel = true; |
131 GWT.log("ZOOM TO: " + initial); | 145 |
132 getMap().zoomToExtent(initial); | 146 // if (this.floodMap != null) |
133 } | 147 // this.floodMap.destroy(); |
134 }); | |
135 } | 148 } |
136 | 149 |
137 protected void initLayout() { | 150 protected void initLayout() { |
138 this.rootLayout.setHeight100(); | 151 this.rootLayout.setHeight100(); |
139 this.rootLayout.setWidth100(); | 152 this.rootLayout.setWidth100(); |