Skip to content

Add geojson support to map widget - #185

Open
rambip wants to merge 1 commit into
gristlabs:masterfrom
rambip:geojson
Open

Add geojson support to map widget#185
rambip wants to merge 1 commit into
gristlabs:masterfrom
rambip:geojson

Conversation

@rambip

@rambip rambip commented Dec 4, 2025

Copy link
Copy Markdown

This pull request adds experimental geojson support for the map widget.

This fixes #158

The current design choice is the following:

  • keep Longitude and Latitude as required columns, with the asumptions that most users will only want the old behaviour
  • add an optional GeoJSON column. If set, this will take precedence over Latitude and Longitude. The format is the "geometry" key of the geojson standard, and supports any type.

I tried to keep the original behaviour when possible, and adapt it to geojson:

  • The geojson tiles are also clickable, when you click inside the region. When you click it, it changes the opacity.
  • the map bounds are computed using the points in the geometry
  • when there is an error (like: geoJSON and Lat / Long in the same column), an error is displayed. I was not able to see the error even with the original code.

Something I would like to add is a way to specify colors, because it can be very useful for polygons and lines. But it may be outside the scope of this PR.

Note: the formatting is pretty odd at some locations, it would be nice to format the code consistently. I use the typescript formatter with default settings.

@netlify

netlify Bot commented Dec 4, 2025

Copy link
Copy Markdown

Deploy Preview for boisterous-sunburst-a5c941 ready!

Name Link
🔨 Latest commit 3bd7611
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunburst-a5c941/deploys/6931ab450755d00008497fa5
😎 Deploy Preview https://deploy-preview-185--boisterous-sunburst-a5c941.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rambip

rambip commented Jan 23, 2026

Copy link
Copy Markdown
Author

@berhalak any progress on the subject ?

@berhalak

Copy link
Copy Markdown
Contributor

Hi @rambip,

Sorry for the delay. Will review this week.

@berhalak
berhalak removed their request for review April 23, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing polygons feature in map widget

2 participants