failed to fetch image #1509
Unanswered
RicardoBrito1938
asked this question in
Q&A
Replies: 2 comments
-
Hello Guys, just adding some info, i tried other ways to render the image, but i was not lucky return ( see below, i tried to load the Image following this doc, https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#image
); |
Beta Was this translation helpful? Give feedback.
0 replies
-
just an update, it is working as desired now, the issue was on my backend |
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
-
Hello team, i am trying to add an image to my map, but it always show "error to fetch"
please, see my code, if there is any other info i can provide to help, please, let me know
const loadImage = () => {
const map = mapRef?.current?.getMap();
map.loadImage(
'https://assets.perfectflight.com.br/johndeere/sandbox/ApplicationRateResult_NDg1NTExXzYwN2RkZDJlMDRjY2Y3MTcwMGZlNDU0Mg.png',
(error: any, image: any) => {
if (error) throw error;
map.addImage('johnDeerApp', image, { sdf: true });
},
);
};
useEffect(() => {
loadImage();
}, [mapRef]);
Beta Was this translation helpful? Give feedback.
All reactions