diff --git a/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapLayerFactory.java b/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapLayerFactory.java index 7c36e82..a3f7e7d 100644 --- a/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapLayerFactory.java +++ b/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapLayerFactory.java @@ -82,7 +82,10 @@ public IsLayer prepareLayer(final LayerProps c) { layer.getInfo().setTitle(c.getTitle()); layer.getInfo().setName(c.getName()); layer.getInfo().setBundle(c.getBundleName()); - + final String attribution = c.getAttribution(); + if (attribution != null) { + layer.asLayer().getSource().setAttributions(attribution); + } final Projection projection = layer.asLayer().getSource().getProjection(); if (c.getMinScale() != null && projection != null) { layer.asLayer().setMinResolution(OL3GeometryUtil.scaleToResolution(c.getMinScale(), projection)); diff --git a/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapUtil.java b/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapUtil.java index 3c770ef..43b446e 100644 --- a/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapUtil.java +++ b/gwt-client-geo-ol3/src/main/java/nl/aerius/geo/wui/util/OL3MapUtil.java @@ -30,6 +30,8 @@ import ol.OLFactory; import ol.View; import ol.ViewOptions; +import ol.control.Attribution; +import ol.control.AttributionOptions; import ol.control.Control; import ol.control.MousePosition; import ol.control.ScaleLine; @@ -82,6 +84,10 @@ private static void prepareControls(final Map map, final MapProperties mapProps) map.addControl(new Zoom()); map.addControl(new ZoomSlider()); map.addControl(new ScaleLine()); + final AttributionOptions attributionOptions = new AttributionOptions(); + attributionOptions.setCollapsible(false); + attributionOptions.setCollapsed(false); + map.addControl(new Attribution(attributionOptions)); final MousePosition mousePosition = new MousePosition();