感谢您在这里提供帮助。我已经构建了一个MapBox应用程序。我想在MapBox的版权徽标之前添加一个版权。我将L.control.attribution用作:
varName = L.control.attribution({prefix: 'some text'}).addTo(map);我使用了FireFox检查器,发现some text是->的子项,它是来自leaflet.css的class="leaflet-control-attribution leaflet-control"。
我有自己的custom.css文件,并尝试使用它覆盖leaflet.css中的leaflet-control-attribution类,但它不起作用。这是来自MapBox.css的防止重写的东西还是来自leaflet的东西?有解决方案来解决这个问题吗?我只想更改L.control.attribution DOM对象的父div的背景。
提前谢谢。
艾哈迈德
发布于 2016-04-27 13:51:38
你可以用这种方法做。
var leafletMap = L.map('map').setView([23.709921, 90.407143], 7);
leafletMap.attributionControl.addAttribution('Licensed by © <a href="some_link", class="your_class">Habijabi</a>');发布于 2016-02-26 22:32:59
你可以传递一个html文本来代替"sometext“。
varName = L.control.attribution({prefix: '<span class="AttributionClass">some text</span>'}).addTo(map);发布于 2017-02-20 20:40:25
leaflet control--归因可能正在被覆盖。请尝试将“!important”添加到css属性。
https://stackoverflow.com/questions/35544442
复制相似问题