MapFeatures
Renders all GeoJSON features from the current map context
Props
| Parameter | Type | Default | Description |
|---|---|---|---|
idKey? | string | id | Resolves feature key via feature[idKey], then feature.properties[idKey] |
styles? | MapObjectStyles | — | Forwarded to MapFeature in default rendering mode, see styling guide |
Use native SVG presentation attrs like fill and stroke directly on MapFeatures.
Usage
vue
<template>
<Map :data="mapData">
<MapFeatures
fill="darkorange"
:styles="{
default: { opacity: 0.9 },
hover: { opacity: 0.7 },
active: { stroke: '#1f2937', strokeWidth: 1.5 },
}"
/>
<MapMesh stroke="slategray" />
</Map>
</template>Slots
vue
<template>
<MapFeatures #default="{ features }">
<MapFeature
v-for="feature in features"
:fill="feature.color"
:key="feature.id"
:data="feature"
/>
</MapFeatures>
</template>