Skip to content

Compare BaseMap Control

Usecase

  • Compare two base maps using a swipe/side-by-side interaction.
  • Useful for visual QA or demonstrating style differences.

Props

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

and

PropDescriptionTypeRequiredDefault Value
titlestringfasle``
defaultBaseMapstringfasleOpen Street Map
controlIconstringfasle``
baseMapsBaseMapItem[]arrayfasle``

Slots

NameDescription
defaultid:string

Events

EventPayloadDescription
basemap-changeBasemapFired when basemap changes

Usage

vue
<script setup lang="ts">
import { Map } from '@hungpvq/vue-map-core';
import { CompareBaseMapControl } from '@hungpvq/vue-map-basemap';
import '@hungpvq/vue-map-core/style.css';
import '@hungpvq/vue-map-basemap/style.css';
const baseMaps = [];
</script>

<template>
  <Map>
    <CompareBaseMapControl :baseMaps="baseMaps" />
  </Map>
</template>