Skip to content

Commit 075f1cb

Browse files
committed
【fix】ol 矢量瓦片 兼容sprite图错误时的处理 review by xiongjj
1 parent 563c2ec commit 075f1cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/openlayers/overlay/vectortile/MapboxStyles.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ export class MapboxStyles extends Observable {
275275
this._spriteImage = img;
276276
this._initStyleFunction();
277277
};
278+
img.onerror = () => {
279+
this._spriteImage = null;
280+
this._initStyleFunction();
281+
}
278282
img.src = this._spriteImageUrl;
279283
});
280284
} else {

0 commit comments

Comments
 (0)