单击标记野生动物园时,弹出窗口无法打开 [英] Popup does not open when clicking on marker safari

查看:36
本文介绍了单击标记野生动物园时,弹出窗口无法打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在显示Django模型的位置,例如带有弹出标记的

I am showing position from django model like marker with popup:

我的查看文件

<script>
        const MAP_KEY = "{{ MAP_KEY }}";
        const added_place_json = JSON.parse('{{ added_place_json | escapejs}}');
</script>

我的js文件

for (const place of added_place_json){
L.marker([place.fields.lat, place.fields.long]).bindPopup(
    `<div class="card" style="width: 15rem;">\n` +
    ` <h6 class="card-header">Name place:<br>${place.fields.name}</h6>\n` +
    `  <div class="card-body">\n` +
    `    <p class="card-text" style="overflow: scroll">Place comment:<br>${place.fields.comment}</p>\n` +
    `  </div>\n` +
    `</div>`
).addTo(map)

};

这在google chrome上很好用,但在safari上不起作用.当我点击野生动物园中的标记时,没有任何反应

This works well on google chrome, but it doesn't work on safari. When I click on the marker in safari nothing happens

推荐答案

这是Leaflet 1.7.1的错误,请参见传单#7255

This is a bug of Leaflet 1.7.1, see Leaflet #7255

在最新的主版传单中,该手册正在运行,请参见问题注释

In the newest master version of leaflet it is working, see Issue Comment

因此,我建议将您的leaflet-src从Leaflet版本1.7.1更改为Github上的master分支

So I recommand to change your leaflet-src from the Leaflet Release 1.7.1 to the master branch on Github

这篇关于单击标记野生动物园时,弹出窗口无法打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆