mariusandra / pigeon-maps

ReactJS Maps without external dependencies
https://pigeon-maps.js.org/
MIT License
3.44k stars 142 forks source link

Implement a Geo Json Component #149

Closed baldulin closed 2 years ago

baldulin commented 2 years ago

Hey, I warned you I needed more features this is currently a very simple approach to a GeoJson Component. So I would argue that one could easily merge it into the main project without creating its own package for it.

It implements the following geometries (which should be all of them):

The features can be styled using either svgAttributes for all features, or a callback styleCallback which will also notify if a feature is hovered.

And they support the same events as the marker does, a bit copy&paste there.

I think people might need or require a lot more (popups for instance) but GeoJson is a really easy standard, and at least if someone needs more than the basic features provided here they will be able to look in a simple reference implementation and extend it themselves.

Right now the added components will be:

Edit: Forgot to add this issue

baldulin commented 2 years ago
1. Can you run `prettier --write` on all the changed files? I suggest you set your IDE to do this automatically as well.

Oh that was a good hint I thought this was done by the git-hooks automatically. Also made me realize that I'm not that used to yarn to be honest.

I also forgot to run yarn build this lead to a lot of typescript bugs I had to fix. So there's some changes now. And I made the GeoJsonFeature component useful.

  1. Can you also submit a PR to the pigeon-maps.js.org website repo with the new components?

Yep should be done.

mariusandra commented 2 years ago

Great work! Thanks for all of this and apologies for the long delay.

Version 0.21.0 released with the changes.