Skip to content
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][Leaflet] Fix Popup's automatic-content #2035

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Aug 8, 2024

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

Leaflet's Popup does not have headerContent, but GoogleMaps does.

To prevent too many issues when developpers change for another Map Bridge, with Simon we took the decision to render headerContent and content data in Leaflet Popup's content.

But it looks like I've did things wrong, if I don't specify headerContent, then a null text is displayed in the popup:
Capture d’écran 2024-08-08 à 14 01 11

Because in JavaScript, null + 'foo' gives nullfoo :(
Capture d’écran 2024-08-08 à 14 04 29

With this PR, the popup is now nicely displayed:
Capture d’écran 2024-08-08 à 14 08 14

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Aug 8, 2024
@Kocal Kocal force-pushed the fix/map-leaflet-infowindow-null branch from cd33c3a to 33fce10 Compare August 8, 2024 12:16
@javiereguiluz
Copy link
Member

Nice fix! I like the (concise and modern) JS code that you used here. Thanks Hugo.

@javiereguiluz javiereguiluz merged commit 14d222a into symfony:2.x Aug 8, 2024
38 checks passed
@Kocal Kocal deleted the fix/map-leaflet-infowindow-null branch August 8, 2024 13:28
@Kocal
Copy link
Member Author

Kocal commented Aug 8, 2024

Thanks for quick merging Javier :)

@Kocal Kocal added the Map label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Map Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants