-
-
Notifications
You must be signed in to change notification settings - Fork 364
[Map] Add Rectangle support #2845
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
[Map] Add Rectangle support #2845
Conversation
📊 Packages dist files size differenceThanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
|
e0b3f91
to
e76d201
Compare
dd132b1
to
861c5c9
Compare
Co-authored-by: Hugo Alliaume <hugo@alliau.me>
…mputing `@id` is expected
…r `Circle` and `Rectangle` instances
861c5c9
to
93c31b0
Compare
foreach ($attrs['circles'] as $key => $circle) { | ||
$attrs['circles'][$key]['@id'] = $computeId($circle); | ||
} | ||
|
||
foreach ($attrs['rectangles'] as $key => $rectangle) { | ||
$attrs['rectangles'][$key]['@id'] = $computeId($rectangle); | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 :)
Thank you @Valmonzo. |
Adding a new
Rectangle
element to Map following GoogleMaps and Leaflet features.