Skip to content

Commit e87b2b6

Browse files
fix 修复对矢量瓦片 sprite 不存在时判断不正确
1 parent 5ba11fe commit e87b2b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/openlayers/overlay/vectortile/MapboxStyles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export class MapboxStyles extends Observable {
410410
})
411411
}
412412
if (fieldName === 'sprite' || fieldName === 'glyphs' || fieldName === 'url') {
413-
if (typeof styles[fieldName] === 'string' && !CommonUtil.isAbsoluteURL(styles[fieldName])) {
413+
if (styles[fieldName] && typeof styles[fieldName] === 'string' && !CommonUtil.isAbsoluteURL(styles[fieldName])) {
414414
styles[fieldName] = CommonUtil.relative2absolute(styles[fieldName], baseUrl);
415415
}
416416
if (paramUrl && !styles[fieldName].includes(paramUrl)) {

0 commit comments

Comments
 (0)