Skip to content
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

Add updateImage API, or allow addImage to update #4804

Open
jfirebaugh opened this issue Jun 7, 2017 · 1 comment · Fixed by #7999
Open

Add updateImage API, or allow addImage to update #4804

jfirebaugh opened this issue Jun 7, 2017 · 1 comment · Fixed by #7999

Comments

@jfirebaugh
Copy link
Contributor

There's currently no API for updating the image associated with a particular ID. gl-native allows updating an image via addImage, but in gl-js that triggers an error.

When implementing this, care should be taken to avoid the gl-js equivalents of mapbox/mapbox-gl-native#6536 and mapbox/mapbox-gl-native#7618.

@astojilj
Copy link
Contributor

Reopening this to check/document the issue with render tests:

"render-tests/runtime-styling/image-update-icon": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804",
"render-tests/runtime-styling/image-update-pattern": "skip - https://github.com/mapbox/mapbox-gl-js/issues/4804",

Fails when enabled and running e.g. yarn test-render image-update-icon:

Error: Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`
    at Map.updateImage (/Users/astojilj/mapbox-gl-js/src/ui/map.js:1669:45)
    at applyOperations (/Users/astojilj/mapbox-gl-js/test/suite_implementation.js:181:34)
    at wait (/Users/astojilj/mapbox-gl-js/test/suite_implementation.js:139:25)
    at applyOperations (/Users/astojilj/mapbox-gl-js/test/suite_implementation.js:144:17)
    at Map.<anonymous> (/Users/astojilj/mapbox-gl-js/test/suite_implementation.js:82:9)
    at Map.fire (/Users/astojilj/mapbox-gl-js/src/util/evented.js:125:26)
    at Map._render (/Users/astojilj/mapbox-gl-js/src/ui/map.js:2481:18)
    at Immediate._onImmediate (/Users/astojilj/mapbox-gl-js/src/ui/map.js:2599:22)
    at processImmediate (internal/timers.js:458:21)
    at process.topLevelDomainCallback (domain.js:137:15)
* failed runtime-styling/image-update-icon

@astojilj astojilj reopened this Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants