Skip to content

[Map] Add possibility to configure extra options #2810

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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

dannyvw
Copy link
Contributor

@dannyvw dannyvw commented Jun 2, 2025

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

TODO

Related to #2445 (comment)

Usage:

new LeafletOptions(extra: ['maxZoom' => 1])

@dannyvw dannyvw requested a review from Kocal as a code owner June 2, 2025 08:01
@carsonbot carsonbot added Feature New Feature Map Status: Needs Review Needs to be reviewed labels Jun 2, 2025
@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

Copy link
Contributor

github-actions bot commented Jun 2, 2025

📊 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 (Bridge Google)
map_controller.d.ts 2.73 kB / 828 B 2.78 kB+2% 📈 / 840 B+1% 📈
map_controller.js 11.18 kB / 2.53 kB 11.21 kB0% / 2.53 kB0%
Map (Bridge Leaflet)
map_controller.d.ts 2.04 kB / 672 B 2.07 kB+2% 📈 / 678 B+1% 📈
map_controller.js 9.71 kB / 2.59 kB 9.74 kB0% / 2.6 kB0%

@smnandre
Copy link
Member

smnandre commented Jun 4, 2025

As this is serialized, I guess we should make some minimal type check on the content of extra, no ?

cc @Kocal

@dannyvw
Copy link
Contributor Author

dannyvw commented Jun 5, 2025

@smnandre @Kocal Do you have something in mind?

Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

extra is already used for Marker and cie to let the developper pass extra data from the back to the front, but the difference with the actual system is that extra are not used by UX Map, these extra data are only used in ux:map:* events.

Instead, I suggest you to implement rawOptions on Map options front-side, nothing should be modified backend-side.

Thanks!

@carsonbot carsonbot added Status: Needs Work Additional work is needed and removed Status: Needs Review Needs to be reviewed labels Jun 9, 2025
@dannyvw
Copy link
Contributor Author

dannyvw commented Jun 10, 2025

extra is already used for Marker and cie to let the developper pass extra data from the back to the front, but the difference with the actual system is that extra are not used by UX Map, these extra data are only used in ux:map:* events.

Instead, I suggest you to implement rawOptions on Map options front-side, nothing should be modified backend-side.

Thanks!

If we only change the front-side how can we set options in the backend which are passed to the front? We want to set some options to the map configuration based on configuration from Symfony DI. Example: for the vector layers we need to pass a layerName and apiKey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Map Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants