[Map] Make UX Map compatible with Live Components (and some internal things) #2385
+1,125
−259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here’s a corrected and polished version of your text:
Hi! 😊
This PR enhances the UX Map to be compatible with Live Components, allowing you to interact with the
Map
directly from your PHP code. You can perform actions and see your map update in real-time from the front-end!To achieve this, I had to refactor and improve several areas:
toArray
and newfromArray
methods forMap
,Marker
, and all other value objects could rebuild an equivalent object accurately (e.g.,$marker == Marker::fromArray($marker->toArray())
).view
object containingzoom
,center
,markers
, etc. These properties were split into individual values to improve performance.@id
is now automatically computed for eachMarker
andPolygon
definition. This optimization makes rendering significantly more efficient, avoiding the need to remove and re-render all markers or polygons (and avoiding a visual glitch aswell).Enregistrement.de.l.ecran.2024-11-17.a.10.30.54-2.mov
Enregistrement.de.l.ecran.2024-11-17.a.10.28.15-2.mov