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 control support custom #2413

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Attribution control support custom #2413

merged 1 commit into from
Sep 5, 2024

Conversation

deyihu
Copy link
Collaborator

@deyihu deyihu commented Aug 30, 2024

fix #1320

  const map = new maptalks.Map("map", {
            center: [120.5965, 31.2189],
            zoom: 13,
            bearing: 0,
            pitch: 0,
            zoomControl: true,
            spatialReference: {
                projection: "EPSG:3857",
            },
            attribution: false


        });




        const layer1 = new maptalks.TileLayer("base1", {
            urlTemplate: "https://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
            subdomains: ["a", "b", "c", "d"],
            attribution: "&copy; <a href='http://osm.org'>OpenStreetMap</a> contributors, &copy; <a href='https://carto.com/'>CARTO</a>",
        }).addTo(map);

        const control = new maptalks.control.Attribution({ custom: true });
        control.addTo(map);

        control.setContent('hello hello hello');

@fuzhenn fuzhenn merged commit 0c3fcd0 into maptalks:master Sep 5, 2024
1 check passed
@deyihu deyihu deleted the 1320 branch September 5, 2024 05:52
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

Successfully merging this pull request may close these issues.

map.attributionControl 提供 addAttribution 和 removeAttribution 方法
2 participants