Skip to content

Geojson popup content not showing up #100

@achourasia

Description

@achourasia

I have a geojson (tri.json) which has polygons with popup content. When I plot it with folium as follows, the popup does not work. If I import my json at geojson.io the popup works fine.

What may be going wrong?

tri.py

    import folium

    # Map origin
    cx = -117.7495299743632
    cy = 35.74053999839425

    # Set center and zoom level of the map
    map_1 = folium.Map(location=[cy, cx], zoom_start=12,)

    # Mark center - this popup works
    #map_1.polygon_marker(location=[cy,cx], popup=str('This one works'))

    # Add patches to the map
    map_1.geo_json(geo_path='tri.json')

    map_1.create_map(path="tri.html", plugin_data_out=True)

tri.json

{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -117.7495299744,
              35.7405399984
            ],
            [
              -117.7422264169,
              35.7472081889
            ],
            [
              -117.7521555454,
              35.7536368252
            ]
          ]
        ]
      },
      "type": "Feature",
      "id": 1,
      "properties": {
        "name": "AirportLake,Subsection0",
        "popupContent": "sid:1 fault:AirportLake,Subsection0"
      }
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature request or idea about how to make folium better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions