-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
When using Leaflet Control Layers, the attribution of the WMS Layer stays the same.
// Add WMS source/layers
var source = L.wms.source("http://ows.terrestris.de/osm/service", {
"format": "image/png",
"transparent": "true",
"attribution": "Some attribution to be removed, when 'Topographic' is not selected in LayerControls",
"info_format": "text/html",
"tiled": false
});
var layers = {'Topographic': source.getLayer("TOPO-WMS").addTo(map)};
// Create layer control
L.control.layers(undefined, layers).addTo(map);
When using Leaflets WMS Method, the attribution is shown and hidden correctly:
var source = L.tileLayer.wms('http://ows.terrestris.de/osm/service?', {
layers: "TOPO-WMS",
format: "image/png",
transparent: "true",
attribution: "Some attribution to be removed, when 'Topographic' is not selected in LayerControls",
info_format: "text/html",
tiled: false
})
var layers = {'Topographic': source.addTo(map)};
// Create layer control
L.control.layers(undefined, layers).addTo(map);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels