Skip to content

GeoJsonPopup doesn't work (v 0.11.0) - TypeError: e.target.getBounds is not a function #1345

Closed
@zoesn89

Description

@zoesn89

Hey 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 ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions