Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 4739:5014a84c0c7d
Add "maptype" parameter to MapInfoService.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 02 Jan 2013 15:24:18 +0100 |
parents | 8ca06d3040d0 |
children | ce570c74aa94 |
comparison
equal
deleted
inserted
replaced
4738:d93748043cbc | 4739:5014a84c0c7d |
---|---|
1 package de.intevation.flys.client.client.ui.map; | 1 package de.intevation.flys.client.client.ui.map; |
2 | 2 |
3 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
4 import com.google.gwt.user.client.rpc.AsyncCallback; | 4 import com.google.gwt.user.client.rpc.AsyncCallback; |
5 import com.google.gwt.user.client.ui.AbsolutePanel; | 5 import com.google.gwt.user.client.ui.AbsolutePanel; |
6 | |
6 import com.smartgwt.client.util.SC; | 7 import com.smartgwt.client.util.SC; |
7 import com.smartgwt.client.widgets.Canvas; | 8 import com.smartgwt.client.widgets.Canvas; |
8 import com.smartgwt.client.widgets.events.ParentMovedEvent; | 9 import com.smartgwt.client.widgets.events.ParentMovedEvent; |
9 import com.smartgwt.client.widgets.events.ParentMovedHandler; | 10 import com.smartgwt.client.widgets.events.ParentMovedHandler; |
10 import com.smartgwt.client.widgets.events.ResizedEvent; | 11 import com.smartgwt.client.widgets.events.ResizedEvent; |
43 import de.intevation.flys.client.shared.model.Recommendation; | 44 import de.intevation.flys.client.shared.model.Recommendation; |
44 import de.intevation.flys.client.shared.model.Theme; | 45 import de.intevation.flys.client.shared.model.Theme; |
45 import de.intevation.flys.client.shared.model.ThemeList; | 46 import de.intevation.flys.client.shared.model.ThemeList; |
46 import de.intevation.flys.client.shared.model.WMSLayer; | 47 import de.intevation.flys.client.shared.model.WMSLayer; |
47 | 48 |
49 import java.util.HashMap; | |
48 import java.util.List; | 50 import java.util.List; |
49 | 51 |
50 import org.gwtopenmaps.openlayers.client.Bounds; | 52 import org.gwtopenmaps.openlayers.client.Bounds; |
51 import org.gwtopenmaps.openlayers.client.Map; | 53 import org.gwtopenmaps.openlayers.client.Map; |
52 import org.gwtopenmaps.openlayers.client.MapWidget; | 54 import org.gwtopenmaps.openlayers.client.MapWidget; |
92 protected MapWidget mapPanel; | 94 protected MapWidget mapPanel; |
93 protected Canvas mapPanelCanvas; | 95 protected Canvas mapPanelCanvas; |
94 protected VLayout rootLayout = new VLayout(); | 96 protected VLayout rootLayout = new VLayout(); |
95 protected AbsolutePanel absPan = new AbsolutePanel(); | 97 protected AbsolutePanel absPan = new AbsolutePanel(); |
96 protected FloodMap floodMap; | 98 protected FloodMap floodMap; |
99 protected java.util.Map<String, String> wmsUrls = new HashMap<String, String>(); | |
97 | 100 |
98 | 101 |
99 public MapOutputTab( | 102 public MapOutputTab( |
100 String title, | 103 String title, |
101 Collection collection, | 104 Collection collection, |
435 return null; | 438 return null; |
436 } | 439 } |
437 | 440 |
438 | 441 |
439 public Layer createWMSLayer(Theme theme) { | 442 public Layer createWMSLayer(Theme theme) { |
440 if (theme == null) { | 443 if (theme == null || !(theme instanceof AttributedTheme)) { |
441 return null; | 444 return null; |
442 } | 445 } |
443 | 446 |
444 AttributedTheme at = (AttributedTheme) theme; | 447 AttributedTheme at = (AttributedTheme) theme; |
445 | 448 |
446 //String type = at.getAttr("name"); | 449 String name = at.getAttr("name"); |
447 //String desc = at.getAttr("description"); | 450 String desc = at.getAttr("description"); |
448 String url = at.getAttr("url"); | 451 String url = at.getAttr("url"); |
449 String layers = at.getAttr("layers"); | 452 String layers = at.getAttr("layers"); |
450 | 453 |
451 if (url == null || layers == null) { | 454 if (url == null || layers == null) { |
452 return null; | 455 return null; |
453 } | 456 } |
454 | 457 |
455 //boolean baseLayer = type.equals("floodmap.wmsbackground"); | 458 this.wmsUrls.put(name, url); |
456 | 459 |
457 WMSParams params = new WMSParams(); | 460 WMSParams params = new WMSParams(); |
458 params.setLayers(layers); | 461 params.setLayers(layers); |
459 params.setFormat("image/png"); | 462 params.setFormat("image/png"); |
460 params.setIsTransparent(true); | 463 params.setIsTransparent(true); |
467 WMS wms = new WMS(layers, url, params, opts); | 470 WMS wms = new WMS(layers, url, params, opts); |
468 wms.setIsVisible(at.getActive() == 1); | 471 wms.setIsVisible(at.getActive() == 1); |
469 wms.setIsBaseLayer(false); | 472 wms.setIsBaseLayer(false); |
470 | 473 |
471 return wms; | 474 return wms; |
475 } | |
476 | |
477 | |
478 public java.util.Map<String, String> wmsUrls() { | |
479 return this.wmsUrls; | |
472 } | 480 } |
473 | 481 |
474 | 482 |
475 protected MapToolbar createControlPanel() { | 483 protected MapToolbar createControlPanel() { |
476 return new MapToolbar(this, floodMap, false); | 484 return new MapToolbar(this, floodMap, false); |