Skip to content

Commit b535583

Browse files
committed
fix(VectorTileSource): error if vector tile layer style is undefined.
1 parent 7051c54 commit b535583

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Source/VectorTilesSource.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ class VectorTilesSource extends TMSSource {
129129

130130
onLayerAdded(options) {
131131
super.onLayerAdded(options);
132-
const keys = Object.keys(this.styles);
132+
if (options.out.style) {
133+
const keys = Object.keys(this.styles);
133134

134-
keys.forEach((k) => { this.styles[k].parent = options.out.style; });
135+
keys.forEach((k) => { this.styles[k].parent = options.out.style; });
136+
}
135137
}
136138
}
137139

0 commit comments

Comments
 (0)