Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java @ 5032:4bf3b89b38d5
Added attribution to osm wms background layer.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 20 Feb 2013 09:53:24 +0100 |
parents | 04ccec566689 |
children | 2c1045a1e3fe |
comparison
equal
deleted
inserted
replaced
5031:9c529b9de6b5 | 5032:4bf3b89b38d5 |
---|---|
37 | 37 |
38 import java.util.LinkedHashMap; | 38 import java.util.LinkedHashMap; |
39 import java.util.List; | 39 import java.util.List; |
40 | 40 |
41 import org.gwtopenmaps.openlayers.client.Map; | 41 import org.gwtopenmaps.openlayers.client.Map; |
42 import org.gwtopenmaps.openlayers.client.control.Attribution; | |
42 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; | 43 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
43 import org.gwtopenmaps.openlayers.client.format.GeoJSON; | 44 import org.gwtopenmaps.openlayers.client.format.GeoJSON; |
44 import org.gwtopenmaps.openlayers.client.layer.WMS; | 45 import org.gwtopenmaps.openlayers.client.layer.WMS; |
45 import org.gwtopenmaps.openlayers.client.layer.WMSOptions; | 46 import org.gwtopenmaps.openlayers.client.layer.WMSOptions; |
46 import org.gwtopenmaps.openlayers.client.layer.WMSParams; | 47 import org.gwtopenmaps.openlayers.client.layer.WMSParams; |
267 | 268 |
268 if (geojson != null && geojson.length() > 0) { | 269 if (geojson != null && geojson.length() > 0) { |
269 VectorFeature[] features = new GeoJSON().read(geojson); | 270 VectorFeature[] features = new GeoJSON().read(geojson); |
270 floodMap.getBarrierLayer().addFeatures(features); | 271 floodMap.getBarrierLayer().addFeatures(features); |
271 } | 272 } |
272 | 273 map.addControl(new Attribution()); |
273 map.zoomToMaxExtent(); | 274 map.zoomToMaxExtent(); |
274 } | 275 } |
275 | 276 |
276 | 277 |
277 protected WMS getLayer(String url, String layers, String proj, boolean x) { | 278 protected WMS getLayer(String url, String layers, String proj, boolean x) { |
283 WMSOptions opts = new WMSOptions(); | 284 WMSOptions opts = new WMSOptions(); |
284 opts.setProjection(proj); | 285 opts.setProjection(proj); |
285 opts.setSingleTile(true); | 286 opts.setSingleTile(true); |
286 opts.setRatio(1); | 287 opts.setRatio(1); |
287 opts.setBuffer(0); | 288 opts.setBuffer(0); |
288 | 289 if (layers.equals("OSM-WMS-Dienst")) { |
290 opts.setAttribution(MSG.attribution()); | |
291 } | |
289 WMS wms = new WMS(layers, url, params, opts); | 292 WMS wms = new WMS(layers, url, params, opts); |
290 wms.setIsVisible(true); | 293 wms.setIsVisible(true); |
291 wms.setIsBaseLayer(x); | 294 wms.setIsBaseLayer(x); |
292 | 295 |
293 return wms; | 296 return wms; |