You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would need to know if an image has already been added or not, would it be possible to expose a map.getImage function? I can see that addImage is already "protected":
if (this.imageManager.getImage(id)) {
return this.fire('error', {error: new Error('An image with this name already exists.')});
}
But I would like to avoid the error message and prevent from calling map.addImage upfront by checking is the image is already there in my application.
mapbox-gl-js version: 0.42.2
The text was updated successfully, but these errors were encountered:
try {
this.map.addImage('arrow-head', image);
} catch (e) {
console.log('image with id "arrow-head" is already exists');
}
Even if i use 'try-catch' i still get error.
vendor.bundle.js:44292 Error: An image with this name already exists.
at t.addImage (vendor.bundle.js:44178) [angular]
at e.addImage (vendor.bundle.js:44266) [angular]
Hello,
I would need to know if an image has already been added or not, would it be possible to expose a
map.getImage
function? I can see thataddImage
is already "protected":But I would like to avoid the error message and prevent from calling
map.addImage
upfront by checking is the image is already there in my application.mapbox-gl-js version: 0.42.2
The text was updated successfully, but these errors were encountered: