Skip to content

HomeControl

Usecase

  • Reset view to a predefined center/zoom for consistent navigation.
  • Provide a “back to extent” button after user pans/zooms around.

Props

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

and

PropDescriptionTypeRequiredDefault Value
zoomnumberfalse-
center[number,number]false-

Events

Slots

NameDescription
defaultid:string

Usage

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

<template>
  <Map>
    <HomeControl />
  </Map>
</template>