Skip to content

RD-901 Fix style.json changes not being reflected in CubemapLayer #209

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

lesbaa
Copy link
Contributor

@lesbaa lesbaa commented Jun 18, 2025

Objective

To fix a bug where changes to style.json only partially applies changes in CubemapLayer

Description

  • add promises and callback to loadCubemapTexture to ensure onReady callback is only fired when all images are loaded
  • add image.complete check to avoid non-firing of load event when image is cached.
  • refactor logic that updates texture when styles are changed.

Acceptance

Manually

Checklist

  • I have added relevant info to the CHANGELOG.md Changelog is updated in release.

Les Moffat added 2 commits June 18, 2025 14:57
- Remove memozing of texture when images are already cached.
- Refactor loadCubemapTexture to callback instead of pure func
@lesbaa lesbaa merged commit 5dd4b6e into RD-25-24 Jun 18, 2025
1 check passed
@lesbaa lesbaa deleted the RD-901-additional-spacebox-bugs branch June 18, 2025 15:29
lesbaa added a commit that referenced this pull request Jul 2, 2025
* Add spacebox support

* Update radial gradient implementation

* Make biome happy

* fix(spacebox): remove chromaKey in favour of transparent images

* fix(spacebox): allow image config to be set for spacebox
- transparent test images
- allow config for object, `path` string or `preset` string

* chore(package.json): install types from color conversion

* chore(/demos): add dummy images with transparency for testing

* feat(halo): implement config setup for creating radial gradient:
- refactor gradient shader to allow for proper scaling
- refactor classes to separate halo and spacebox concerns as they may be used separately.
- restructure directory appropriately given they're separate now
- utility function to convert css color string to [r,g,b,a] vec4

* feat(demos): implement spacebox demo with halo and new config

* chore(version): version bump

* chore:
 - npm i
 - appease linter

* fix(demos): make demo gradient a little more mellow

* chore(lint): appease linter and fix lint errors

* fix(spacebox): add defaults for halo and cubemap layer

* chore(lint): appease linter

* chore(demo): revert demo to show config options

* feat(radialgradient/spacebox): implement stylejson for styling of RadialGradientLayer and Spacebox

* fix(webgl-utils): remove use of lib and use cavnas.context2D instead for parsing color.

* feat(cubemap / gradient): add logic for choosing priority of options.

* fix(demos): update demos

* chore(docs): update changelog and readme

* chore(package.json) npm i

* fix(space): fix priority of optsions passed to space and halo config in map initializer

* chore: version bump

* fix(github): fix broken npm action

* fix(spacebox): reload spacebox and halo upon style change

* chore(demos): fix spacebox demo

* chore: version bump

* fix(lint): appease linter

* fix(spacebox): ensure that spacebox style is set when setStyle is called with json

* chore(package): version bump

* chore(pack): package fix version

* chore(Map): appease linter

* chore(package.json): version bump

* fix(Spacebox):
- handle undefined `style` returned from `Map.getStyle()` and warn user
- Log context in warnings in RadialGradientLayer and CubemapLayer

* chore(package.json): version bump

* fix(package.json): add `main` field for installation compatibility

* fix(CubeMapLayer): appease ts by testing for texture existence

* chore(package): version bump 3.1.0-rc8

* fix(.github):

-add step to check if build failed silently.
- update husky precommit to run typescheck
- add typechecking to github action

* RD-578 Dynamically create canvas ctx to avoid breaking on isomorphic apps

* RD-578 Version Bump

* RD-910
- fix bug that prevented spacebox from being set correclty when style was changed.
- add simple lerping between space color and radial gradient to make the experince less jarring

* RD-910 Fix typechgeck error in setSpaceFromStyle and setHaloFromStyle

* RD-1001 prep spacebox for release (#202)

* Rd 881 version bump for client js (#184)

* RD-881
- Version bump of maptiler-client-js
- update changelog

* 3.1.1

---------

Co-authored-by: Les Moffat <[email protected]>

* Use named import in the Readme (#182)

* Use named import in the Readme

Named import is better practice as it will lead to smaller bundle size when used

* fix spacing

* Rd 877 update maplibre (#183)

* RD-877
- Update Maplibre to 5.3.1
- fix broken demos

* 3.2.0

* RD-877 Update readme

* RD-877 Update changelog and MapTiler ClientJS version

---------

Co-authored-by: Les Moffat <[email protected]>

* RD-902 Fixes MapLibre direct import due to CJS issues (#190)

* RD-902 Fixes MapLibre direct import due to CJS issues

* 3.2.1

* RD-902 Add RC suffix for testing

* RD-902 Update changelog

* RD-902
- Add eslint config to check for non-default import from maplibre-js
- version bump

* RD-902 Update eslint regex condition to only catch maplibre-gl lib

---------

Co-authored-by: Les Moffat <[email protected]>

* Rd 902/remove eslint mjs from tsconfig (#191)

* RD-902 Remove eslint from tsconfig

* RD-902 Add github action to prevent build being publish when it fails

* RD-902 update changelog

* 3.2.2

---------

Co-authored-by: Les Moffat <[email protected]>

* hotfix: remove duplicate commands from github publish action (#193)

Co-authored-by: Les Moffat <[email protected]>

* Rd 685 implement demos with vite (#195)

* RD-685 Convert Demos to using vite build process for easier development.

* RD-685 Remove superfluous imports from vite-dev

* RD-685 remove superfluous markup

* RD-685 add EOL character to html files

---------

Co-authored-by: Les Moffat <[email protected]>

* RD-685 Fix type exports (#197)

* RD-685 Fix type exports

* 3.2.3

* RD-685 update changelog

---------

Co-authored-by: Les Moffat <[email protected]>

* Rd 864 unified linting config (#198)

* RD-864 Update lint config and migrate eslint config to typescript

* RD-864 Remove unused config file

---------

Co-authored-by: Les Moffat <[email protected]>

* RD-924 Update CHANGELOG.md (#199)

Co-authored-by: Les Moffat <[email protected]>

* RD-957 Update MapLibre to latest version (#200)

* RD-957 Update MapLibre to latest version

* 3.3.0

* RD-957 Update changelog

* RD-957 Use correct version in changelog

---------

Co-authored-by: Les Moffat <[email protected]>

* Rd 864 unified linting config (#201)

* RD-864 Update lint config and migrate eslint config to typescript

* RD-864 Remove unused config file

* RD-864
- Add vite plugin to copy lint config across
- add additional files to .npmignore
- convert lint config to .mjs

* RD-864
- Convert demos eslint config to mjs
- re-add- demos to tsconfig

* RD-924 Rename eslint.config.ts to mjs again (overridden by merge changes)

* RD 924 Fix linting and ts build errors

---------

Co-authored-by: Les Moffat <[email protected]>

* RD-1001 Add spacebox demo to new format

* RD-1001

- Update Spacebox to transition between images.
- Better naming of interfaces

* RD-1001 Appease linter

* RD-1001 Update demos/public/04-ready-event.html

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Les Moffat <[email protected]>
Co-authored-by: petr-hajek <[email protected]>
Co-authored-by: Copilot <[email protected]>

* RD-25-22 Update changelog

* RD-578 Fix changelog typo

* RD-900 fix flyto directly after setting style (#203)

* RD-900 Add scratch pad demo for development purposes

* RD-900 Add try / catch to super.setStyle call to catch blocking errors from internal async race condition when changing style.

---------

Co-authored-by: Les Moffat <[email protected]>

* Rd 578 space box (#205)

* RD-1001
- Update readme
- Add presets
- update demos to showcase presets

* RD-1001
- Update readme
- More granular control over color and faces in CubemapLayer

* RD-1001 Update changelog

* RD-1001 Remove superfluous code

* RD-1001
- Update inline docs
- update demos for better showcasing

* RD-1001 Update tests and snapshots

---------

Co-authored-by: Les Moffat <[email protected]>

* 3.4.0

* RD-1001 Update changelog

* RD-1001 Update changelog correctly

* RD-1001 Changes options so that presets are respected

* RD-901 Misc Spacebox fixes: (#207)

* RD-901 Misc Spacebox fixes:
- fix to account for layers being removed when setStyle is called
- adds "milyway-colored" preset
- exposes `getConfig` method to retrive
- update demos to show new method

* RD-901 Fix ts annotation in cubemaplayer.ts

* RD-901 Reduce some logging to dev only

* RD-901 Appease linter

---------

Co-authored-by: Les Moffat <[email protected]>

* Release:
- bump Maplibre Version

* 3.4.1

* Release: Update changelog

* Release: Update changelog

* RD-25-24 Fix new maplibre exports

* RD-901 Fix style.json changes not being reflected in CubemapLayer (#209)

* RD-901
- Remove memozing of texture when images are already cached.
- Refactor loadCubemapTexture to callback instead of pure func

* RD-901 Appease linter

---------

Co-authored-by: Les Moffat <[email protected]>

* Hotfix: add github action to run lint and publish dry-run on PR

* RD-1026 Fix defaults for CubemapLayer

* CL-3791 Version bump client-js (#212)

* CL-3791 Version bump client-js

* CL-3791 Update changelog

---------

Co-authored-by: Les Moffat <[email protected]>

---------

Co-authored-by: Sebastian <[email protected]>
Co-authored-by: Les Moffat <[email protected]>
Co-authored-by: petr-hajek <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant