Skip to content

Attribution doesnt get removed #76

@trafficonese

Description

@trafficonese

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions