Skip to content

Component Apps: Add support for GeoJSON features #1224

Merged
swainn merged 12 commits into
mainfrom
reactpy-fixes
Dec 31, 2025
Merged

Component Apps: Add support for GeoJSON features #1224
swainn merged 12 commits into
mainfrom
reactpy-fixes

Conversation

@shawncrawley

@shawncrawley shawncrawley commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Description

I received feedback from someone trying to learn Component Apps that they were not able to display GeoJSON on their map. Turns out that this was a shortcoming of Comopnent Apps that has now been addressed with this PR. A new Recipe was added to document how this is now done.

Changes Made to Code

  • tethys_components/resources/reactjs_module_wrapper_template.js was updated to more robustly handle events
  • tethys_apps/static/tethys_apps/js/ol-mods.js was added to handle unique GeoJSON cases
  • tethys_components/library.py was updated to included an OVERRIDES variable that can override built-in library components with a custom component. In this case, the lib.ol.source.Vector component is overridden with the custom lib.olmod.VectorSource package that points to "tethys_apps/static/tethys_apps/js/ol-mods.js"

Related PRs, Issues, and Discussions

Additional Notes

Quality Checks

  • At least one new test has been written for new code
  • New code has 100% test coverage
  • Code has been formatted with Black
  • Code has been linted with flake8
  • Docstrings for new methods have been added
  • The documentation has been updated appropriately

@coveralls

coveralls commented Dec 19, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling b7040fd on reactpy-fixes
into 935a361 on main.

@shawncrawley

Copy link
Copy Markdown
Contributor Author

This one should be good to go. Merry Christmas!

@swainn swainn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a few debugging lines that need to be removed.

Comment thread tethys_apps/static/tethys_apps/js/ol-mods/Overlay.js Outdated
Comment thread tethys_apps/static/tethys_apps/js/ol-mods/Overlay.js Outdated
Comment thread tethys_apps/static/tethys_apps/js/ol-mods/source/Image.js
Comment thread tethys_apps/static/tethys_apps/js/ol-mods/Overlay.js Outdated
Comment thread tethys_apps/static/tethys_apps/js/ol-mods/Overlay.js Outdated
@swainn swainn merged commit edfbc10 into main Dec 31, 2025
29 checks passed
@swainn swainn deleted the reactpy-fixes branch December 31, 2025 00:48
jakeymac pushed a commit that referenced this pull request Mar 19, 2026
Component Apps: Add support for GeoJSON features
jakeymac pushed a commit that referenced this pull request May 28, 2026
Component Apps: Add support for GeoJSON features
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.

3 participants