Skip to content

make mapContainerId a configurable prop - #12877

Open
tha-nordiq wants to merge 2 commits into
geosolutions-it:masterfrom
nordiq-group:mapid
Open

tha-nordiq wants to merge 2 commits into
geosolutions-it:masterfrom
nordiq-group:mapid

Conversation

@tha-nordiq

Copy link
Copy Markdown
Contributor

Description

the map container id is hardcoded as "map". this prevents having two separate maps embedded in a single webpage.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

#12872

What is the current behavior?
the div container always has "map" as id

What is the new behavior?
you can now supply a mapContainerId prop to the map to get a different id.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

the change is backwards compatible.

Other useful information

@cla-bot cla-bot Bot added the CLA Ready label Sep 10, 2026
@tdipisa tdipisa added this to the 2026.03.00 milestone Sep 10, 2026
@tdipisa tdipisa linked an issue Sep 10, 2026 that may be closed by this pull request
6 tasks
@tdipisa

tdipisa commented Sep 10, 2026

Copy link
Copy Markdown
Member

Thank you very much for your contribution to the MapStore codebase. We will review it as soon as possible. Many thanks.

@allyoucanmap allyoucanmap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @tha-nordiq, thanks for the contribution, I just added an inline question, thanks

static propTypes = {
mapType: PropTypes.string,
map: PropTypes.object,
mapContainerId: PropTypes.string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a prop provided via cfg? If so it would be better to have it documented in the JSDoc inside this file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point!
yes you can control this via cfg

                            {
                                "name": "Map",
                                "cfg": {
                                    "mapContainerId": "abc"
                                }
                            },

ill update the inline doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for multiple embedded maps in one page with frontendapi

3 participants