Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribution doesnt get removed #76

Open
trafficonese opened this issue Apr 20, 2023 · 0 comments
Open

Attribution doesnt get removed #76

trafficonese opened this issue Apr 20, 2023 · 0 comments

Comments

@trafficonese
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant