Skip to content

[Map] Add Rectangle support - #2845

Merged
Kocal merged 4 commits into
symfony:2.xfrom
Valmonzo:feat/add-rectangle-support-for-map
Jun 22, 2025
Merged

Kocal merged 4 commits into
symfony:2.xfrom
Valmonzo:feat/add-rectangle-support-for-map

Conversation

@Valmonzo

@Valmonzo Valmonzo commented Jun 17, 2025 •

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
Docs? yes
Issues
License MIT

Adding a new Rectangle element to Map following GoogleMaps and Leaflet features.

Capture d’écran 2025-06-17 à 13 43 36 Capture d’écran 2025-06-17 à 13 44 23

@github-actions

github-actions Bot commented Jun 17, 2025 •

Copy link
Copy Markdown
Contributor

📊 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 5.75 kB / 1.25 kB 6.6 kB+15% 📈 / 1.35 kB+8% 📈
abstract_map_controller.js 4.48 kB / 1.14 kB 5.01 kB+12% 📈 / 1.2 kB+6% 📈
Map (Bridge Google)
map_controller.d.ts 3.03 kB / 866 B 3.35 kB+11% 📈 / 909 B+5% 📈
map_controller.js 12.54 kB / 2.72 kB 13.67 kB+9% 📈 / 2.86 kB+5% 📈
Map (Bridge Leaflet)
map_controller.d.ts 2.63 kB / 781 B 2.93 kB+12% 📈 / 829 B+6% 📈
map_controller.js 11.06 kB / 2.77 kB 12.18 kB+10% 📈 / 2.92 kB+6% 📈

@Valmonzo
Valmonzo force-pushed the feat/add-rectangle-support-for-map branch 2 times, most recently from e0b3f91 to e76d201 Compare June 17, 2025 11:47
@Valmonzo
Valmonzo marked this pull request as ready for review June 17, 2025 11:49
@Valmonzo
Valmonzo requested a review from Kocal as a code owner June 17, 2025 11:49
@carsonbot carsonbot added Feature New Feature Map Status: Needs Review Needs to be reviewed labels Jun 17, 2025
@Valmonzo Valmonzo changed the title [Map] Add support for rectangle [Map] Add Rectangle support Jun 17, 2025
Comment thread src/Map/CHANGELOG.md Resolved
@Valmonzo
Valmonzo requested a review from Kocal June 22, 2025 10:38
@Kocal
Kocal force-pushed the feat/add-rectangle-support-for-map branch from dd132b1 to 861c5c9 Compare June 22, 2025 14:54
@Kocal
Kocal force-pushed the feat/add-rectangle-support-for-map branch from 861c5c9 to 93c31b0 Compare June 22, 2025 14:55
Comment on lines +111 to +118
foreach ($attrs['circles'] as $key => $circle) {
$attrs['circles'][$key]['@id'] = $computeId($circle);
}

foreach ($attrs['rectangles'] as $key => $rectangle) {
$attrs['rectangles'][$key]['@id'] = $computeId($rectangle);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The @id computation was missing from last PR and this one, it was not possible to use them correctly when using the Map with a LiveComponent.

I've improved our tests to assert that @id are present and nicely computed, for the next Elements instances properties.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Modifying this file was also forgotten in the previous PR and this one. Without these modifications, it was not possible to use <twig:ux:map circles="{{ ... }}"> or ux_map(circles=[]). Same for rectangles.

@Kocal Kocal left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had to fix some things, but it led to an opportunity to improve tests :)

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Jun 22, 2025
@Kocal

Kocal commented Jun 22, 2025

Copy link
Copy Markdown
Member

Thank you @Valmonzo.

@Kocal
Kocal merged commit 919f896 into symfony:2.x Jun 22, 2025
@Valmonzo
Valmonzo deleted the feat/add-rectangle-support-for-map branch June 22, 2025 16:00
Kocal added a commit that referenced this pull request Jun 22, 2025
…and `Rectangle` (Kocal)

This PR was merged into the 2.x branch.

Discussion
----------

[Map][Google] Fix `InfoWindow` compatibility with `Circle` and `Rectangle`

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Update/add documentation as required (we can help!)
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Looks like using `InfoWindow` with Google Maps `Circle` and `Rectangle` has not been tested when working on #2845  and #2838  :(

Commits
-------

ac68141 [Map][Google] Fix `InfoWindow` compatibility with `Circle` and `Rectangle`
Kocal added a commit that referenced this pull request Jun 23, 2025
…tributes (Valmonzo)

This PR was merged into the 2.x branch.

Discussion
----------

[Map] Update test to include circle and rectangle data attributes

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Fix typo from #2845 and missing circles attributes from #2838 , sorry `@Kocal` 😞

Commits
-------

2b65124 [Map] Update test to include circle and rectangle data attributes
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