dash-leaflet icon indicating copy to clipboard operation
dash-leaflet copied to clipboard

Polygon GeoJSON from url won't add to map

Open colinbrust opened this issue 4 months ago • 0 comments

I am unable to add a .fgb polygon as a GeoJSON feature to my Dash Leaflet map. I tested this using Python 3.12 with dash==3.1.1 and dash-leaflet==1.1.2. Using the Flatgeobuf example on the GeoJSON tutorial page, I am unable to reproduce the example in the docs. Here are the steps to reproduce:

  1. Create script: uv init --script test.py --python 3.12
  2. Add dependencies: uv add --script test.py 'dash-leaflet==1.1.2' 'dash==3.1.1'
  3. Download the .fgb from the example and move it to your pwd: https://github.com/emilhe/dash-leaflet-docs/raw/refs/heads/main/assets/us-counties.fgb
  4. Paste in the Flatgeobuf code into test.py and replace "url=/assets/us-counties.fgb" with "url=./us-counties.fgb".
  5. Run with uv run test.py.

This pulls up a map, but the us counties are not displayed. I have also tested by pointing the url to the raw file url on GitHub, and also tested pointing to a .fgb I have stored on a file server and have used for other projects.

colinbrust avatar Jul 31 '25 18:07 colinbrust