Skip to content

[Map] Add multipolygon support #2762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged

[Map] Add multipolygon support #2762

merged 1 commit into from
May 26, 2025

Conversation

dannyvw
Copy link
Contributor

@dannyvw dannyvw commented May 22, 2025

Q A
Bug fix? no
New feature? yes
Docs? yes/no
Issues Fix #...
License MIT

Add support for MultiPolygon https://leafletjs.com/reference.html#polygon & https://developers.google.com/maps/documentation/javascript/shapes?hl=fr#polygon_hole

image image

@dannyvw dannyvw requested a review from Kocal as a code owner May 22, 2025 09:52
@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels May 22, 2025
@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@dannyvw dannyvw changed the title Map add multipolygon support [Map] Add multipolygon support May 22, 2025
@dannyvw dannyvw force-pushed the multipolygon branch 3 times, most recently from 6f614dd to a69ab63 Compare May 22, 2025 09:57
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Is it possible to have some preview of what it renders? Because I don't see anything on Leaflet website :/
Also, does it work with Google Maps?

@dannyvw
Copy link
Contributor Author

dannyvw commented May 24, 2025

Thanks for your contribution!

Is it possible to have some preview of what it renders? Because I don't see anything on Leaflet website :/ Also, does it work with Google Maps?

@Kocal It is the example under “Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.” with the outer ring and hole.

Google Maps https://developers.google.com/maps/documentation/javascript/shapes#polygon_hole

@Kocal
Copy link
Member

Kocal commented May 24, 2025

I meant a visual preview, with a map screenshot :D But that's fine, the Google Maps demo and tweaking Leaflet page helped me to understand what's a multipolygon:
image

So, to move forward, there are still modifications to do:

  1. Improve the CHANGELOG, by quickly explaining what's a MultiPolygon with a small code example
  2. Change the documentation too, to show how to create a MultiPolygon
  3. Types for methods Polygon::__construct(), Polygon::toArray() and Polygon::fromArray() must be updated
  4. Types for PolygonDefinition TypeScript type must also been updated

Feel free to ask if you need help, thanks! :)

Copy link

github-actions bot commented May 24, 2025

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
Map
abstract_map_controller.d.ts 4.95 kB / 1.15 kB 4.97 kB0% / 1.16 kB+1% 📈

@dannyvw dannyvw force-pushed the multipolygon branch 2 times, most recently from 55f536b to cebbf4e Compare May 24, 2025 09:32
@dannyvw
Copy link
Contributor Author

dannyvw commented May 24, 2025

@Kocal I pushed some changes. Is this fine or should I do something more?

@Kocal
Copy link
Member

Kocal commented May 24, 2025

That's much better, thanks! :)

Except the documentation/changelog things, that's great, I will try to find some time tonight to test your PR and some minor changes

@dannyvw
Copy link
Contributor Author

dannyvw commented May 25, 2025

@Kocal Let me know if I need to change something :)

@Kocal
Copy link
Member

Kocal commented May 26, 2025

As mentioned in #2762 (comment), can you please check the checkbox to allow maintainers to edit your PR's code? It would makes things much easier to work on.

Thanks 🙏🏻

@dannyvw
Copy link
Contributor Author

dannyvw commented May 26, 2025

@Kocal I don’t see that option. I think this is because the fork is in a organisation?

I have added you to the repo.

@Kocal
Copy link
Member

Kocal commented May 26, 2025

Yeah you are supposed to see this:
image

Maybe that's the fault of the organization thing, yes... I don't really know 😅

Thanks for the invitation tho, that's better than nothing :)

@Kocal Kocal added the Map label May 26, 2025
@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels May 26, 2025
@Kocal
Copy link
Member

Kocal commented May 26, 2025

Thank you @dannyvw.

@Kocal Kocal merged commit a890400 into symfony:2.x May 26, 2025
23 of 24 checks passed
@Kocal Kocal deleted the multipolygon branch May 26, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Map Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants