Fix transparent sprites in IE11 (#45108)
* Fix transparent sprites in IE11 IE11 can not load data URIs via XHR. Instead, we create a new Image and assign the src to the data uri for the transparent image. * eslint appeasement
This commit is contained in:
parent
5887526723
commit
f792287a3b
|
@ -46,9 +46,6 @@ const TOOLTIP_TYPE = {
|
||||||
LOCKED: 'LOCKED'
|
LOCKED: 'LOCKED'
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line max-len,camelcase
|
|
||||||
const TRANSPARENT_1x1_BASE64_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=';
|
|
||||||
|
|
||||||
export class MBMapContainer extends React.Component {
|
export class MBMapContainer extends React.Component {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
@ -396,12 +393,13 @@ export class MBMapContainer extends React.Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mbMap.on('load', () => {
|
mbMap.on('load', () => {
|
||||||
mbMap.loadImage(TRANSPARENT_1x1_BASE64_URI, (error, data) => {
|
emptyImage = new Image();
|
||||||
emptyImage = data;
|
// eslint-disable-next-line max-len
|
||||||
|
emptyImage.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=';
|
||||||
|
emptyImage.crossOrigin = 'anonymous';
|
||||||
resolve(mbMap);
|
resolve(mbMap);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _initializeMap() {
|
async _initializeMap() {
|
||||||
|
|
Loading…
Reference in a new issue