Skip to content

Commit 4cf476c

Browse files
author
Les Moffat
committed
RD-910 Fix typechgeck error in setSpaceFromStyle and setHaloFromStyle
1 parent 211cb71 commit 4cf476c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Map.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ export class Map extends maplibregl.Map {
232232
});
233233
}
234234

235-
private setSpaceFromStyle({ style }: { style?: StyleSpecificationWithMetaData }) {
235+
private setSpaceFromStyle({ style }: { style: StyleSpecificationWithMetaData }) {
236236
if (!style?.metadata?.maptiler?.space) {
237237
return;
238238
}
239239
this.space?.setCubemap(style.metadata.maptiler.space);
240240
}
241241

242-
private setHaloFromStyle({ style }: { style?: StyleSpecificationWithMetaData }) {
242+
private setHaloFromStyle({ style }: { style: StyleSpecificationWithMetaData }) {
243243
if (!style?.metadata?.maptiler?.halo) {
244244
return;
245245
}
@@ -959,13 +959,15 @@ export class Map extends maplibregl.Map {
959959

960960
if (typeof styleInfo.style !== "string" && !styleInfo.requiresUrlMonitoring) {
961961
if (this.space) {
962-
this.setSpaceFromStyle({ style });
962+
const styleWithMetaData = styleInfo.style as StyleSpecificationWithMetaData;
963+
this.setSpaceFromStyle({ style: styleWithMetaData });
963964
} else {
964965
this.initSpace({ before });
965966
}
966967

967968
if (this.halo) {
968-
this.setHaloFromStyle({ style });
969+
const styleWithMetaData = styleInfo.style as StyleSpecificationWithMetaData;
970+
this.setHaloFromStyle({ style: styleWithMetaData });
969971
} else {
970972
this.initHalo({ before });
971973
}

0 commit comments

Comments
 (0)