Skip to content

MapLegend Control

Usecase

  • Display dynamic legend based on visible layers and symbology.
  • Provide contextual guidance for map colors, lines, and symbols.

Props

PropDescriptionTypeRequiredDefault Value
mapIdstringfalse--
dragIdstringfalse--
btnWidthnumberfalse40
position'top-left', 'top-right', 'bottom-left', 'bottom-right'false'bottom-right'
controlVisiblebooleanfalsetrue

Slots

NameDescription
defaultCustom legend content slot

Usage

vue
<script setup lang="ts">
import { Map } from '@hungpvq/vue-map-core';
import { LegendControl } from '@hungpvq/vue-map-legend';
import '@hungpvq/vue-map-core/style.css';
import '@hungpvq/vue-map-legend/style.css';
</script>

<template>
  <Map>
    <LegendControl />
  </Map>
</template>