Skip to content

Commit 9cddeb9

Browse files
committed
fix(ol-source-vector): correctly distinguish between vector / heatmap layer injections
prevent injection warnings
1 parent 5543929 commit 9cddeb9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/sources/OlSourceVector.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ const props = withDefaults(
3838
}
3939
);
4040
41-
const layer =
42-
inject<Ref<VectorSource<Geometry>> | null>("vectorLayer") ||
43-
inject("heatmapLayer");
41+
const vectorLayer = inject<Ref<VectorSource<Geometry>> | null>(
42+
"vectorLayer",
43+
null
44+
);
45+
const heatmapLayer = inject<Ref<VectorSource<Geometry>> | null>(
46+
"heatmapLayer",
47+
null
48+
);
49+
const layer = heatmapLayer || vectorLayer;
50+
4451
const { properties } = usePropsAsObjectProperties(props);
4552
4653
const source = computed(

0 commit comments

Comments
 (0)