GeoJsonPopup doesn't work (v 0.11.0) - TypeError: e.target.getBounds is not a function
See original GitHub issueHey guys,
I try to use the GeoJsonPopup module to display names etc. When I run the code, no error is displayed in the shell, but when I open the html file and click on a marker, no popup show up and in the console there is following error:
Uncaught TypeError: e.target.getBounds is not a function
at i.click (geojson_test.html:85)
at i.fire (leaflet.js:5)
at i._fireDOMEvent (leaflet.js:5)
at i._handleDOMEvent (leaflet.js:5)
at HTMLDivElement.s (leaflet.js:5)
here is a snippet of my code:
import folium
import pandas
import geopandas
tileset= "https://api.mapbox.com/styles/v1/f---/cj53iitnb0cxr2rp96gsee7dx/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoiZjJkYXoiLCJhIjoiY2o1M2hrczV0MDc1bDJ2bjBiYWdha2c0diJ9.uEHH_ty------"
m = folium.Map(location=[50.032,10.519], zoom_start=14, tiles=tileset, attr="Mapbox")
data = geopandas.read_file('stationen.json', driver='GeoJSON')
stationen = folium.GeoJson(
data,
name='Stationen',
popup = folium.GeoJsonPopup(
fields=['shortname', 'voltage_level'],
aliases=['Name', 'Spannungsebene'],
)
).add_to(m)
m.save("geojson_test.html")
Environment
- Browser: chrome
- html file
- folium version 0.11.0
Thanks in advance 😉
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
leaflet layer.getbounds not a function - Stack Overflow
I'm trying to make it when I zoom in on eachFeature, it filters the table to those features. Below is my script that...
Read more >Can Leaflet method .getBounds() be used on a layer to ...
getBounds ().contains() to do this won't work using the grid layer ... I am currently getting a leaflet-src.js:1873 Uncaught TypeError: ...
Read more >weixin_39576133的博客_CSDN博客-领域博主
华为服务器上传文件后怎么通过链接查看,远程服务器文件上传后的操作,服务器换完主板后无盘进不了系统,更换主板后主板认不出硬盘无法进入系统的办法– ...
Read more >Issues-python-visualization/folium - PythonTechWorld
GeoJsonPopup doesn't work (v 0.11.0) - TypeError: e.target.getBounds is not a function ... Hey guys, I try to use the GeoJsonPopup module to...
Read more >[closed] map.getBounds() Not Working... - OSM Help
How to get map corner latlong in OSM. i have many tried to solve it but i did not solve it. i have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jtbaker I made a small fix, do you maybe want to check it out? https://github.com/python-visualization/folium/pull/1349
Thanks for looking into this Jason! Two other related things that may provide ideas:
getBounds()
optional.getBounds()
is defined on an object before calling it.I’d have to look a bit more at that GeoJsonMarker thing to comment on how useful it is to spend time on that. I can say that if possible I’d rather separate it from fixing this particular issue.