[Map] Create Map component#1937
Conversation
4fd1a57 to
1fb9b9b
Compare
|
Very useful component :) |
c97965e to
f73bf19
Compare
|
That's awesome ! Thank you for this PR ! I checked my projects with Google Maps integration, there is some features missing here :
|
|
Hi @simondaigre, and thank you! :)
It's already on my list! I will need this feature aswell for my website where I use custom marker icons: But I don't wanted to do too much things in a single PR. Implementing
I've started to implement the API/configuration for map styles (with some classes and enums), but I've finally removed it when I knew about Cloud-based maps styling.
I think we would not include it in Symfony UX Map by default, a documentation would be enough IMO :) |
|
(i will make a big review this week-end ;) ) |
|
A first comment before touching the real work :) It is not possible to use Google Map without explicit consent of the user in Europe, California i think, Japan maybe, Australia too You are of course not responsible of this, but i think some use case or implementation consequences should be discussed now
|
|
... 😮💨 , but yeah you're right, thanks for pointing it out. I think the easiest way to do that is to:
For example with the Didomi CMP: <script>
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(() => {
function loadGoogleMapsIfConsentGiven() {
const googleMapsPurposeId = '...';
const googleMapsVendorId = '...';
const userStatus = Didomi.getUserStatus();
const enabledPurposeConsent = userStatus.purposes.consent.enabled;
const enabledVendorConsent = userStatus.vendors.consent.enabled;
if (enabledPurposeConsent.includes(googleMapsPurposeId) && enabledVendorConsent.includes(googleMapsVendorId)) {
window.loadSymfonyUxGoogleMaps();
}
}
if (Didomi.shouldConsentBeCollected()) {
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
event: 'consent.changed',
listener: function (event) {
loadGoogleMapsIfConsentGiven();
}
});
} else {
loadGoogleMapsIfConsentGiven();
}
});
</script>WDYT? |
5dbbc6d to
09be8b1
Compare
|
Do we have a list of things left to do here before making this mergeable? Or is this fully finished and just needs a final review? Thanks! |
|
It's merged now! 🎉🎉🎉 Hugo, infinite thanks for contributing this amazing new component 🙇🙇🙇 and thank you all for the nice discussion and review that you did here. Now, let's test it in real apps, let's iterate on it and let's add good docs for the community. Thanks! |
|
Thanks @javiereguiluz :) But we still need to set-up git repositories for UX Map bridges (Google and Leaflet), AFAIK only Fabien can do that..? Do you think we can get in touch with him? 🙏 Thanks! |
|
@Kocal Can you list what needs to be done? Based on that, I will do the magic ;) |
|
So quick! :D We will need dedicated repositories for:
So packages And like other Symfony components, bridges source code should not be present in Thanks :) |
| @@ -0,0 +1,33 @@ | |||
| { | |||
| "name": "symfony/ux-map-google", | |||
There was a problem hiding this comment.
Should be symfony/ux-google-map to be consistent with how we are naming bridges in Symfony.
| @@ -0,0 +1,33 @@ | |||
| { | |||
| "name": "symfony/ux-map-leaflet", | |||
There was a problem hiding this comment.
Should be symfony/ux-leaflet-map to be consistent with how we are naming bridges in Symfony.
|
@Kocal All done. Can you double-check that everything has been configured properly? |
|
@fabpot thanks! |
|
Cannot wait to play with it! What an incredible PR this was, thank you very much for your patience, hard work and positive spirit @Kocal! 👏 |
Good catch, I used |
|
We can move folders around in the ux mono if that can ease things. |
|
All good now 🤞 |
|
Thanks Fabien :) |

Hi :)
This PR is a proposal for #38 a replacement for #39.
Symfony UX Map is a new Symfony UX component that makes it easy to create, customize and use interactive JavaScript maps.
The package ships with:
Example
Bridge configuration
Map creation
An example to render a map, custom center and zoom, some markers and info windows:
Map rendering
You must call
render_map(map)to render the map:{{ render_map(map, { style: 'height: 700px; width: 1024px; margin: 10px' }) }}It gives you this interactive Leaflet map: