gpt4 book ai didi

leaflet - 删除属性不是函数

转载 作者:行者123 更新时间:2023-12-05 01:27:51 27 4
gpt4 key购买 nike

大家好,我正在尝试删除传单 map 上的传单 Logo ,但每当我尝试使用 removeattribution 删除 Logo 时,它都说这不是一个函数。我正在这样做 L.removeattribution().addTo(map)。请告诉我我做的是否正确或有什么问题。

最佳答案

使用 L.MapattributionControl 选项:

Whether the attribution control is added to the map by default.

http://leafletjs.com/reference.html#map-attributioncontrol

new L.Map('container', {
'attributionControl': false
});

如果你想在初始化 map 后删除它,你可以使用 L.MapremoveControl 方法:

Removes the given control from the map.

http://leafletjs.com/reference.html#map-removecontrol

属性控件实例存储为 L.Map 实例的属性 attributionControl:

var map = new L.Map('container');

map.removeControl(map.attributionControl);

关于leaflet - 删除属性不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35403981/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com