求大神帮助!代码如上,用开发工具为pycharm,在网上搜了一些教程对着做,把地图保存为html文件后,点击蓝色标记、或者把鼠标移动到标记上都无法显示出popup和tooltip里的信息。
求原因和解决方法!!
这是因为生成的html中jquery的地址错误,做如下修改即可
<!-- <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>-->
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
把
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
改为
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
这里有详细教程,希望对你有帮助。
python可视化实例_Python地图可视化
https://blog.csdn.net/weixin_31063029/article/details/113489831
用vscode运行试试看能来得到想要的结果。运行弹窗正常,html的head部分代码,
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://rawcdn.githack.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css"/>