Skip to content

Commit 116b576

Browse files
committed
feat(ol-vector-tile-layers): add support for renderMode property
closes #263
1 parent e8280e1 commit 116b576

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/componentsguide/layers/vectortilelayer/index.md

+10
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,13 @@ The maximum view zoom level (inclusive) at which this layer will be visible.
8585
- **Type**: `number`
8686
- **Default**: `0`
8787
Low-resolution tiles up to preload level will be load.
88+
89+
### renderMode
90+
91+
- **Type**: `'hybrid' | 'vector'`
92+
- **Default**: `hybrid`
93+
94+
Render mode for vector tiles.
95+
96+
- `hybrid`: Polygon and line elements are rendered as images, so pixels are scaled during zoom animations. Point symbols and texts are accurately rendered as vectors and can stay upright on rotated views.
97+
- `vector`: Everything is rendered as vectors. Use this mode for improved performance on vector tile layers with only a few rendered features (e.g. for highlighting a subset of features of another layer with the same source).

src/components/layers/OlVectorTileLayer.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
<script setup lang="ts">
88
import { inject, provide, onUnmounted, onMounted, watch, computed } from "vue";
9-
import VectorTileLayer from "ol/layer/VectorTile";
9+
import VectorTileLayer, {
10+
type VectorTileRenderType,
11+
} from "ol/layer/VectorTile";
1012
import type Map from "ol/Map";
1113
import usePropsAsObjectProperties from "@/composables/usePropsAsObjectProperties";
1214
import {
@@ -24,13 +26,15 @@ const props = withDefaults(
2426
updateWhileAnimating?: boolean;
2527
styles?: StyleLike | FlatStyleLike | null;
2628
updateWhileInteracting?: boolean;
29+
renderMode?: VectorTileRenderType;
2730
}
2831
>(),
2932
{
3033
...layersCommonDefaultProps,
3134
renderBuffer: 100,
3235
updateWhileAnimating: false,
3336
updateWhileInteracting: false,
37+
renderMode: "hybrid",
3438
},
3539
);
3640

0 commit comments

Comments
 (0)