Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 4476:099d136b215b
Try to fix resize problems with MapWidget in DigitizePanel (#802).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 12 Nov 2012 21:12:08 +0100 |
parents | c84630d544a1 |
children | 4c2c1d4cf777 |
rev | line source |
---|---|
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui.map; |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
4 import com.google.gwt.user.client.rpc.AsyncCallback; |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
5 import com.google.gwt.user.client.ui.AbsolutePanel; |
4064
61020a61ed38
Show river map only once.
Christian Lins <christian.lins@intevation.de>
parents:
3347
diff
changeset
|
6 |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
7 import com.smartgwt.client.util.SC; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.widgets.Canvas; |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
9 import com.smartgwt.client.widgets.events.ResizedEvent; |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
10 import com.smartgwt.client.widgets.events.ResizedHandler; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.layout.HLayout; |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
12 import com.smartgwt.client.widgets.layout.VLayout; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
13 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; |
1542
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
14 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
16 import de.intevation.flys.client.client.Config; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
17 import de.intevation.flys.client.client.FLYSConstants; |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
18 import de.intevation.flys.client.client.event.OutputParameterChangeEvent; |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
19 import de.intevation.flys.client.client.event.OutputParameterChangeHandler; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
20 import de.intevation.flys.client.client.event.RedrawRequestEvent; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
21 import de.intevation.flys.client.client.event.RedrawRequestHandler; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
22 import de.intevation.flys.client.client.services.LoadArtifactService; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
23 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
24 import de.intevation.flys.client.client.services.MapOutputService; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
25 import de.intevation.flys.client.client.services.MapOutputServiceAsync; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
26 import de.intevation.flys.client.client.services.StepForwardService; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
27 import de.intevation.flys.client.client.services.StepForwardServiceAsync; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
28 import de.intevation.flys.client.client.ui.CollectionView; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
29 import de.intevation.flys.client.client.ui.OutputTab; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
30 import de.intevation.flys.client.client.ui.ThemePanel; |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
31 import de.intevation.flys.client.shared.model.Artifact; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
32 import de.intevation.flys.client.shared.model.ArtifactDescription; |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
33 import de.intevation.flys.client.shared.model.AttributedTheme; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 import de.intevation.flys.client.shared.model.Collection; |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
35 import de.intevation.flys.client.shared.model.Data; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
36 import de.intevation.flys.client.shared.model.DataItem; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
37 import de.intevation.flys.client.shared.model.DataList; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
38 import de.intevation.flys.client.shared.model.DefaultData; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
39 import de.intevation.flys.client.shared.model.DefaultDataItem; |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
40 import de.intevation.flys.client.shared.model.MapConfig; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
41 import de.intevation.flys.client.shared.model.OutputMode; |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
42 import de.intevation.flys.client.shared.model.Recommendation; |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
43 import de.intevation.flys.client.shared.model.Theme; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
44 import de.intevation.flys.client.shared.model.ThemeList; |
1412
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
45 import de.intevation.flys.client.shared.model.WMSLayer; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
47 import java.util.List; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
48 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
49 import org.gwtopenmaps.openlayers.client.Bounds; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
50 import org.gwtopenmaps.openlayers.client.Map; |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
51 import org.gwtopenmaps.openlayers.client.MapWidget; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
52 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
53 import org.gwtopenmaps.openlayers.client.event.VectorFeatureRemovedListener; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
54 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
55 import org.gwtopenmaps.openlayers.client.format.GeoJSON; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
56 import org.gwtopenmaps.openlayers.client.layer.Layer; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
57 import org.gwtopenmaps.openlayers.client.layer.Vector; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
58 import org.gwtopenmaps.openlayers.client.layer.WMS; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
59 import org.gwtopenmaps.openlayers.client.layer.WMSOptions; |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
60 import org.gwtopenmaps.openlayers.client.layer.WMSParams; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
1412
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
63 public class MapOutputTab |
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
64 extends OutputTab |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
65 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler { |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
67 public static final String DEFAULT_SRID = "4326"; |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
68 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
69 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
70 |
1269
45791d12a1f4
Bugfix: #298 Floodmaps initial zoom is determined by the WSPLGEN layer's extent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
835
diff
changeset
|
71 public static final String WSPLGEN_FACET = "floodmap.wsplgen"; |
45791d12a1f4
Bugfix: #298 Floodmaps initial zoom is determined by the WSPLGEN layer's extent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
835
diff
changeset
|
72 |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
73 public static final String EXTERNAL_WMS_FACTORY = "externalwmsfactory"; |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
74 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
75 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
76 protected StepForwardServiceAsync feedService = |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
77 GWT.create(StepForwardService.class); |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
78 |
1365
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
79 protected MapOutputServiceAsync mapService = |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
80 GWT.create(MapOutputService.class); |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
81 |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
82 /** Service handle to clone and add artifacts to collection. */ |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
83 protected LoadArtifactServiceAsync loadArtifactService = |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
84 GWT.create(LoadArtifactService.class); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
85 |
1415
dfa2d4753fc0
Triggered the reload of MapThemePanel after adding external WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1414
diff
changeset
|
86 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
dfa2d4753fc0
Triggered the reload of MapThemePanel after adding external WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1414
diff
changeset
|
87 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
88 protected MapToolbar controlPanel; |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
89 protected ThemePanel themePanel; |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
90 protected Canvas themePanelCanvas; |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
91 protected MapWidget mapPanel; |
3347
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
2983
diff
changeset
|
92 protected Canvas mapPanelCanvas; |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
93 protected VLayout rootLayout = new VLayout(); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
94 protected AbsolutePanel absPan = new AbsolutePanel(); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
95 protected FloodMap floodMap; |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 public MapOutputTab( |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 String title, |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 Collection collection, |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 OutputMode mode, |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 CollectionView collectionView |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 ){ |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
104 super(title, collection, collectionView, mode); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
1542
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
106 collectionView.registerTabHandler(this); |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
107 |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
108 mapService.doOut(collection, new AsyncCallback<MapConfig>() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
109 @Override |
1365
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
110 public void onFailure(Throwable caught) { |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
111 GWT.log("MAP ERROR: " + caught.getMessage()); |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
112 } |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
113 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
114 @Override |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
115 public void onSuccess(MapConfig c) { |
1365
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
116 GWT.log("MAP SUCCESS!"); |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
117 |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
118 Bounds max = boundsFromString(c.getMaxExtent()); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
119 Bounds initial = boundsFromString(c.getInitialExtent()); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
120 |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
121 if (initial == null) { |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
122 GWT.log("Warning: No initial extent set."); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
123 initial = max; |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
124 } |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
125 |
4476
099d136b215b
Try to fix resize problems with MapWidget in DigitizePanel (#802).
Christian Lins <christian.lins@intevation.de>
parents:
4402
diff
changeset
|
126 setFloodmap(new FloodMap(c.getSrid(), max, 640, 480)); |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
127 |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
128 initLayout(); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
129 initBarriers(); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
130 |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
131 GWT.log("MAX EXTENT: " + max); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
132 GWT.log("ZOOM TO: " + initial); |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
133 getMap().zoomToExtent(initial); |
1365
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
134 } |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
135 } |
4c65c5b60a86
First step of refactoring the map creation - implemented a MapOutputService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1364
diff
changeset
|
136 ); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 protected void initLayout() { |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
141 rootLayout.setHeight100(); |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
142 rootLayout.setWidth100(); |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
143 rootLayout.setMembersMargin(2); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
144 |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1382
diff
changeset
|
145 final HLayout hlayout = new HLayout(); |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
146 hlayout.setMembersMargin(0); |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
147 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
148 this.themePanelCanvas = createThemePanel(); |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1382
diff
changeset
|
149 |
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1382
diff
changeset
|
150 controlPanel = createControlPanel(); |
3347
6d749af6a9c2
Issue #726 work.
Christian Lins <christian.lins@intevation.de>
parents:
2983
diff
changeset
|
151 mapPanel = floodMap.getMapWidget(); |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
152 |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
153 rootLayout.addMember(controlPanel); |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
154 rootLayout.addMember(absPan); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
155 absPan.setWidth("100%"); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
156 absPan.setHeight("100%"); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
157 absPan.add(themePanelCanvas); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
158 absPan.add(mapPanel); |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
159 |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
160 rootLayout.addResizedHandler(new ResizedHandler() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
161 @Override |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
162 public void onResized(ResizedEvent e) { |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
163 doLayout(); |
798
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
164 } |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
165 }); |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
166 |
7061c2e66039
Finished layouting the map components.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
797
diff
changeset
|
167 setPane(rootLayout); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
168 } |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
169 |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
170 |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
171 protected void doLayout() { |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
172 if(!rootLayout.isVisible()) { |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
173 return; |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
174 } |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
175 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
176 // Manually set the height of the AbsolutePanel, somehow this is necessary |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
177 absPan.setHeight(String.valueOf( |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
178 rootLayout.getHeight() - controlPanel.getHeight() - 2) + "px"); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
179 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
180 // Calculate bounds of Map |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
181 int height = rootLayout.getHeight() - |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
182 controlPanel.getHeight() - 6; |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
183 int width = controlPanel.getWidth() - |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
184 (themePanelCanvas.isVisible() ? themePanelCanvas.getWidth() + 4 : 0); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
185 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
186 // Set size and position of Map |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
187 String w = String.valueOf(width) + "px"; |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
188 String h = String.valueOf(height) + "px"; |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
189 GWT.log("width=" + w); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
190 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
191 mapPanel.setSize(w, h); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
192 if(themePanelCanvas.isVisible()) { |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
193 absPan.setWidgetPosition(mapPanel, themePanelCanvas.getWidth() + 2, 0); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
194 } |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
195 else { |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
196 absPan.setWidgetPosition(mapPanel, 0, 0); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
197 } |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
198 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
199 // Set bounds of ThemePanelCanvas |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
200 themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), String.valueOf(height + 2) + "px"); |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
201 } |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
202 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
203 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
204 protected void initBarriers() { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
205 Vector vector = floodMap.getBarrierLayer(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
206 vector.addVectorFeatureAddedListener( |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
207 new VectorFeatureAddedListener() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
208 @Override |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
209 public void onFeatureAdded(FeatureAddedEvent e) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
210 saveBarriers(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
211 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
212 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
213 ); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
214 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
215 vector.addVectorFeatureRemovedListener( |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
216 new VectorFeatureRemovedListener() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
217 @Override |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
218 public void onFeatureRemoved(FeatureRemovedEvent e) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
219 saveBarriers(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
220 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
221 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
222 ); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
223 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
224 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
225 Artifact artifact = getArtifact(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
226 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
227 if (artifact == null) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
228 return; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
229 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
230 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
231 ArtifactDescription desc = artifact.getArtifactDescription(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
232 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
233 String geojson = getGeoJSONFromStatic(desc); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
234 geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
235 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
236 if (geojson == null || geojson.length() == 0) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
237 GWT.log("No geojson string found -> no barriers existing."); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
238 return; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
239 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
240 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
241 GeoJSON reader = new GeoJSON(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
242 VectorFeature[] features = reader.read(geojson); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
243 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
244 vector.addFeatures(features); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
245 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
246 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
247 |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
248 public void addLayer(Layer layer) { |
1448
c39aa5a6478c
#409 Made layer list and map layers synchron.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1425
diff
changeset
|
249 FloodMap map = getFloodmap(); |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
250 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
251 if (map != null) { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
252 GWT.log("Add new layer '" + layer.getName() + "' to map."); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
253 map.addLayer(layer); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
254 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
255 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
256 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
257 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
258 public void removeLayer(String name) { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
259 Map map = getMap(); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
260 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
261 Layer[] layers = map.getLayers(); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
262 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
263 for (Layer layer: layers) { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
264 if (name.equals(layer.getName())) { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
265 map.removeLayer(layer); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
266 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
267 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
268 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
269 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
270 |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
271 @Override |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
272 public void onRedrawRequest(RedrawRequestEvent event) { |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
273 mapService.doOut(collection, new AsyncCallback<MapConfig>() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
274 @Override |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
275 public void onFailure(Throwable caught) { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
276 GWT.log("MAP ERROR: " + caught.getMessage()); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
277 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
278 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
279 @Override |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
280 public void onSuccess(MapConfig c) { |
1397
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
281 GWT.log("We want to refresh the map now!"); |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
282 themePanel.updateCollection(); |
1397
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
283 getFloodmap().update(); |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
284 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
285 }); |
1364
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
286 } |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
287 |
9981ba2ee13a
Display the datacage button in the map toolbar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1327
diff
changeset
|
288 |
1412
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
289 @Override |
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
290 public void load(List<WMSLayer> toLoad) { |
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
291 GWT.log("The user wants to add " + toLoad.size() + " new WMS layers."); |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
292 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
293 int len = toLoad.size(); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
294 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
295 Recommendation[] recom = new Recommendation[len]; |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
296 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
297 for (int i = 0; i < len; i++) { |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
298 WMSLayer w = toLoad.get(i); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
299 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
300 String ids = w.getServer() + ";" + w.getName() + ";" + w.getTitle(); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
301 recom[i] = new Recommendation(EXTERNAL_WMS_FACTORY, ids); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
302 } |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
303 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
304 Collection c = getCollection(); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
305 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
306 Config config = Config.getInstance(); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
307 String locale = config.getLocale(); |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
308 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
309 loadArtifactService.loadMany(c, recom, EXTERNAL_WMS_FACTORY, locale, |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
310 new AsyncCallback<Artifact[]>() { |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
311 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
312 @Override |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
313 public void onFailure(Throwable throwable) { |
1415
dfa2d4753fc0
Triggered the reload of MapThemePanel after adding external WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1414
diff
changeset
|
314 SC.warn(MSG.getString(throwable.getMessage())); |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
315 } |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
316 |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
317 @Override |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
318 public void onSuccess(Artifact[] newArtifacts) { |
1415
dfa2d4753fc0
Triggered the reload of MapThemePanel after adding external WMS layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1414
diff
changeset
|
319 getThemePanel().updateCollection(); |
1414
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
320 } |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
321 } |
3484cbfaf369
Create new Artifacts for selected WMS layers of the ExternalWMSWindow.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1412
diff
changeset
|
322 ); |
1412
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
323 } |
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
324 |
659a488243da
Added code to trigger loading selected WMS layers from ExternalWMSWindow. Note: no code for loading/adding layers to the current map existing yet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1403
diff
changeset
|
325 |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
326 protected void setFloodmap(FloodMap floodMap) { |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
327 this.floodMap = floodMap; |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
328 } |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
329 |
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
330 |
1397
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
331 protected FloodMap getFloodmap() { |
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
332 return floodMap; |
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
333 } |
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
334 |
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
335 |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
336 protected Map getMap() { |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
337 return floodMap.getMap(); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
338 } |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
339 |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
340 |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
341 protected ThemePanel getThemePanel() { |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
342 return themePanel; |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
343 } |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
344 |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
345 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
346 protected String getGeoJSONFromDynamic(ArtifactDescription desc) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
347 DataList list = desc.getCurrentData(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
348 |
835
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
349 if (list == null) { |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
350 return null; |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
351 } |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
352 |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
353 List<Data> datas = list.getAll(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
354 for (Data data: datas) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
355 String key = data.getLabel(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
356 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
357 if (key != null && key.equals(BARRIERS_PARAMETER_KEY)) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
358 DataItem def = data.getDefault(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
359 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
360 if (def != null) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
361 return def.getStringValue(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
362 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
363 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
364 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
365 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
366 return null; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
367 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
368 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
369 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
370 protected String getGeoJSONFromStatic(ArtifactDescription desc) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
371 // TODO Implement this method, if there are reachable states right after |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
372 // the floodmap state - which is currently not the case. |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
373 return null; |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
374 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
375 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
376 |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
377 public ThemeList getThemeList() { |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
378 return collection.getThemeList(mode.getName()); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
379 } |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
380 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
381 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
382 public String getSrid() { |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
383 ThemeList themeList = getThemeList(); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
384 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
385 int num = themeList.getThemeCount(); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
386 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
387 for (int i = 1; i <= num; i++) { |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
388 AttributedTheme theme = (AttributedTheme) themeList.getThemeAt(i); |
835
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
389 |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
390 if (theme == null) { |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
391 continue; |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
392 } |
c89a42950d11
Removed the digitize controls from map widget that is used in the floodmap state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
825
diff
changeset
|
393 |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
394 String srid = theme.getAttr("srid"); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
395 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
396 if (srid != null && srid.length() > 0) { |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
397 return srid; |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
398 } |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
399 } |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
400 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
401 return DEFAULT_SRID; |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
402 } |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
403 |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
404 |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
405 protected Bounds boundsFromString(String bounds) { |
1376
28eb4dfe2cbf
Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1370
diff
changeset
|
406 GWT.log("Create Bounds from String: '" + bounds + "'"); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
407 if (bounds == null || bounds.length() == 0) { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
408 return null; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
409 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
410 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
411 String[] values = bounds.split(" "); |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
412 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
413 if (values == null || values.length < 4) { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
414 return null; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
415 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
416 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
417 try { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
418 return new Bounds( |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
419 Double.valueOf(values[0]), |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
420 Double.valueOf(values[1]), |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
421 Double.valueOf(values[2]), |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
422 Double.valueOf(values[3])); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
423 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
424 catch (NumberFormatException nfe) {} |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
425 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
426 return null; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
427 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
428 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
429 |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
430 public Layer createWMSLayer(Theme theme) { |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
431 if (theme == null) { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
432 return null; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
433 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
434 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
435 AttributedTheme at = (AttributedTheme) theme; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
436 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
437 //String type = at.getAttr("name"); |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
438 //String desc = at.getAttr("description"); |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1397
diff
changeset
|
439 String url = at.getAttr("url"); |
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1397
diff
changeset
|
440 String layers = at.getAttr("layers"); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
441 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
442 if (url == null || layers == null) { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
443 return null; |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
444 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
445 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
446 //boolean baseLayer = type.equals("floodmap.wmsbackground"); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
447 |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
448 WMSParams params = new WMSParams(); |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
449 params.setLayers(layers); |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
450 params.setFormat("image/png"); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
451 params.setIsTransparent(true); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
452 |
823
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
453 WMSOptions opts = new WMSOptions(); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
454 opts.setProjection("EPSG:" + getSrid()); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
455 opts.setSingleTile(true); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
456 opts.setRatio(1); |
407de0f4b66a
Set the map projection and its max extent dynamically - information extracted from facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
815
diff
changeset
|
457 |
1400
96708d81eaf6
Added an initial GetFeatureInfo tool to get information about points in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1397
diff
changeset
|
458 WMS wms = new WMS(layers, url, params, opts); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
459 wms.setIsVisible(at.getActive() == 1); |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
460 wms.setIsBaseLayer(false); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
461 |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
462 return wms; |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
463 } |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
464 |
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
465 |
1386
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1382
diff
changeset
|
466 protected MapToolbar createControlPanel() { |
9aa1a453eed5
Issue 294.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1382
diff
changeset
|
467 return new MapToolbar(this, floodMap, false); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
468 } |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
469 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
470 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
471 protected Canvas createThemePanel() { |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
472 Canvas c = new Canvas(); |
1327
8a93fb299e64
#288 Added legend symbols to the MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1306
diff
changeset
|
473 c.setMinWidth(300); |
4330
93e023131546
Removed the legend images from map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4329
diff
changeset
|
474 c.setWidth(200); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
475 c.setHeight100(); |
1327
8a93fb299e64
#288 Added legend symbols to the MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1306
diff
changeset
|
476 c.setCanDragResize(true); |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
796
diff
changeset
|
477 c.setBorder("1px solid black"); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
478 |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
479 themePanel = new MapThemePanel( |
1555
c057ef91b268
Refactored Collection reference out of Panels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1542
diff
changeset
|
480 this.getCollectionView(), |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
481 mode, |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
482 this, |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
483 new MapThemePanel.ActivateCallback() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
484 @Override |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
485 public void activate(Theme theme, boolean active) { |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
486 fireActivateTheme(theme, active); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
487 } |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
488 }, |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
489 new MapThemePanel.ThemeMovedCallback() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
490 @Override |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
491 public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
492 // this code synchronizes the ThemePanel and the OpenLayers |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
493 // internal order of layers. |
1403
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
494 AttributedTheme at = (AttributedTheme) theme; |
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
495 |
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
496 String name = at.getAttr("layers"); |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
497 Map map = getMap(); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
498 Layer[] layers = map.getLayersByName(name); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
499 |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
500 if (layers == null || layers.length == 0) { |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
501 GWT.log("Error: Cannot find layer '" + name + "'"); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
502 return; |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
503 } |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
504 |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
505 map.raiseLayer(layers[0], (newIdx-oldIdx)*-1); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
506 map.zoomTo(map.getZoom()-1); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
507 map.zoomTo(map.getZoom()+1); |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
508 } |
1377
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
509 }, |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
510 new MapThemePanel.LayerZoomCallback() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
511 @Override |
1377
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
512 public void onLayerZoom(Theme theme, String extent) { |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
513 Bounds zoomTo = boundsFromString(extent); |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
514 |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
515 if (zoomTo == null) { |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
516 GWT.log("WARNING: No valid bounds for zooming found!"); |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
517 return; |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
518 } |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
519 |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
520 getMap().zoomToExtent(zoomTo); |
b0fe35d4ce6b
Added a 'zoom to layer' menu item to the map theme panel which triggers a zoom to the specific layer/theme.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1376
diff
changeset
|
521 } |
1306
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
522 } |
2e57776f77b5
#300 Synchronized the ThemePanel's layer order with the internal order of the Map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1269
diff
changeset
|
523 ); |
1397
b3264b5770b3
Update the map when receiving a RedrawRequestEvent.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1386
diff
changeset
|
524 themePanel.addRedrawRequestHandler(this); |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
525 themePanel.addOutputParameterChangeHandler(this); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
526 c.addChild(themePanel); |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
527 |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
528 return c; |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
529 } |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
530 |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
531 |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
532 private void fireActivateTheme(Theme theme, boolean active) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
533 activateTheme(theme, active); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
534 } |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
535 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
536 |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
537 protected void activateTheme(Theme theme, boolean active) { |
1403
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
538 AttributedTheme at = (AttributedTheme) theme; |
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
539 |
6a7cfe9d87fe
Repaired broken WMS layer controls in map theme panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1400
diff
changeset
|
540 String name = at.getAttr("layers"); |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
541 Layer layer = floodMap.getMap().getLayerByName(name); |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
542 |
1382
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
543 GWT.log("Set visibility of '" + name + "': " + active); |
78542ff1f562
Update map and theme panel when new layers are added via datacage or removed by context menu.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1377
diff
changeset
|
544 |
806
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
545 if (layer != null) { |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
546 layer.setIsVisible(active); |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
547 } |
e50da1f74e58
The layers created in the floodmap reflect to the facets this output mode has.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
800
diff
changeset
|
548 } |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
549 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
550 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
551 protected void saveBarriers() { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
552 Vector layer = floodMap.getBarrierLayer(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
553 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
554 GeoJSON format = new GeoJSON(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
555 String features = format.write(layer.getFeatures()); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
556 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
557 DataItem item = new DefaultDataItem( |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
558 BARRIERS_PARAMETER_KEY, BARRIERS_PARAMETER_KEY, features); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
559 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
560 Data data = new DefaultData( |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
561 BARRIERS_PARAMETER_KEY, BARRIERS_PARAMETER_KEY, "String", |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
562 new DataItem[] {item} ); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
563 |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
564 Config config = Config.getInstance(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
565 final String locale = config.getLocale(); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
566 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1415
diff
changeset
|
567 feedService.go(locale, getArtifact(), new Data[] { data }, |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
568 new AsyncCallback<Artifact>() { |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
569 @Override |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
570 public void onFailure(Throwable caught) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
571 GWT.log("Could not save barrier geometries: " + |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
572 caught.getMessage()); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
573 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
574 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
575 @Override |
825
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
576 public void onSuccess(Artifact artifact) { |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
577 GWT.log("Successfully saved barrier geometries."); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
578 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
579 } |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
580 ); |
1b9b7e9ab219
Save and reload user defined geometries (barriers) in the map.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
823
diff
changeset
|
581 } |
1542
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
582 |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
583 |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
584 @Override |
1542
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
585 public void onTabSelected(TabSelectedEvent tse) { |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
586 if(floodMap == null) { |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
587 return; |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
588 } |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
589 if(this.equals(tse.getTab())) { |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
590 floodMap.activateScaleLine(true); |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
591 } |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
592 else { |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
593 controlPanel.activateMeasureControl(false); |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
594 floodMap.activateScaleLine(false); |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
595 } |
3e2ef8e0a0dc
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1448
diff
changeset
|
596 } |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
597 |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
598 public void toogleThemePanel() { |
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
599 this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible()); |
4402
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
600 |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
601 // Trigger resize event handler |
c84630d544a1
Get rid of HorizontalLayout in MapOutputTab and use manual resizing.
Christian Lins <christian.lins@intevation.de>
parents:
4330
diff
changeset
|
602 doLayout(); |
2983
725470fc57d2
Add "Manage themes" button to ChartToolbar and MapToolbar.
Christian Lins <christian.lins@intevation.de>
parents:
1555
diff
changeset
|
603 } |
4329
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
604 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
605 |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
606 @Override |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
607 public void onOutputParameterChanged(OutputParameterChangeEvent evt) { |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
608 GWT.log("OutputParameterChanged"); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
609 controlPanel.updateThemes(getThemePanel().getThemeList()); |
c9dcce9448f2
Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4064
diff
changeset
|
610 } |
796
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
611 } |
cd8603aaa730
Improved the process of creating OutputTabs. Added support for map output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
612 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |