Using Promise response from ArcGIS REST API with BitmapLayer (or alternative) #9639
Replies: 2 comments
-
Supplying the URL works fine for me: https://codepen.io/Pessimistress/pen/wBBLpwB?editors=001 You cannot assign a function to the |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Pessimistress you are awesome! Your code helped me realize I need to call // list of layers
const layers: LayersList = [
new BitmapLayer({
id: "wbd",
image: encodeURI(wbdUrl), // should return png
bounds: bounds, //bounds come from useState, format of [number, number, number, number]
}),
]; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am trying to use an API call to an ArcGIS REST API to create a BitmapLayer from the Export Map query of this endpoint.
Background
I am using a MapOverlay (DeckGLOverlay) to render the
deck.gl
layers inside of a MaplibreGl Map usingreact-map-libre
. I am using the mapRef to dynamically create the API call for the image of layers. The code to create the layer currently looks like this:In another attempt, I tried constructing the URL and passing that to BitmapLayer
When I log the formatted URL to the console, it results in a returned image in my browser (example).
I also looked into some of the underlying library functions, including loader.gl's ImageLoader, luma.gl's Texture, and how those fit with loading data with deck.gl.
Finally, when I use my current implementation, I get an error in the console;
deck: matching of BitmapLayer({id: 'wbd'}): texture size deduction failed
Questions
ImageLoader
to handle the implementation?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions