javascript - 传单弹出框问题 - 框角上的小标签。这是某种故障吗?
问题描述
我最近设置了一张传单地图,点击时会弹出工具提示。我认为一切都很完美,直到有人指出每个弹出框的右下角都有这个奇怪的标签(见下图)。
知道是什么原因造成的吗?
这是弹出窗口的代码:
function popUp (feature, layer) {
layer.bindPopup("<h1 class='city_infoheader'>" + feature.properties.city + " </h1><p>PM2.5 Attributable COPD Deaths: "+Math.round(feature.properties.copd) + "</p>");
layer.setIcon(circle);
};
function PoppopUp (feature, layer) {
layer.bindPopup("<h1 class='infoheader'>"+feature.properties.admin+" </h1><p>Country Population: "+feature.properties.pop_est+"</p>");
};
var pmDeaths = new L.geoJson(pmDeaths,{
onEachFeature: popUp,
}).addTo(mymap);
var countryPop = new L.geoJson(countryPop,{
style:countryColor,
onEachFeature: PoppopUp,
}).addTo(mymap);
解决方案
我有同样的问题。如果除了已经包含传单的库(例如,mapbox)之外还包含leaflet.css,则可能存在样式定义的重复/冲突,这将导致弹出提示出现此问题。解决方案是从您的构建中删除leaflet.css。
推荐阅读
- mysql - MySQL 多重“左连接”和“拥有”
- c++ - C ++中的2维数组内存段错误
- filter - Power BI - 从去年获取上个月
- c++ - 如何在不升级 GCC 的情况下解决“未在此范围内声明‘isnan’”?
- shell - 在 Jenkins 中编写脚本作为作业时出错
- javascript - JavaScript 帮助 - 单击事件侦听器以激活 1 个元素节点并停用其他元素节点
- python - 我真的不知道文件扩展名 .data
- ruby-on-rails - Ruby on Rails 6 AWS Elastic Beanstalk 部署命令 reload_initctl_for_sidekiq 失败
- mysql - 查询优化的 SQL 技巧
- git - 远程:在 github 上拒绝回购的权限