Implement Map Story widget loading functionality#69
Open
Rework-Digital wants to merge 2 commits intoSolcast:mainfrom
Open
Implement Map Story widget loading functionality#69Rework-Digital wants to merge 2 commits intoSolcast:mainfrom
Rework-Digital wants to merge 2 commits intoSolcast:mainfrom
Conversation
Added loadMapStoryWidget function to load the Map Story widget script dynamically, with handling for Mapbox token and data container attributes.
Refactor loadMapStoryWidget to cache script loading and improve error handling.
GF-D6
reviewed
Feb 9, 2026
|
|
||
| const dataContainer = container.getAttribute("component-data-container"); | ||
|
|
||
| if (!mapboxToken || !dataContainer) { |
Contributor
There was a problem hiding this comment.
The widget expects both to be present or it will reject.
alex-solcast
reviewed
Feb 9, 2026
| if (!container) return resolve(); | ||
|
|
||
| const src = | ||
| "https://static.solcast.com/2025-global-interactive-story/js/map-story-widget.iife.js"; |
Contributor
There was a problem hiding this comment.
@GF-D6 @Rework-Digital this might work fine, but remember about the strict dynamic directive and how loading scripts needs a nonce:
Line 25 in 30061c0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added loadMapStoryWidget function to load the Map Story widget script dynamically, with handling for Mapbox token and data container attributes.
@alex-solcast