Skip to content

InspectControl

Usecase

  • Inspect rendered features for debugging data and styles.
  • Provide quick identify functionality without building a full query UI.

Props

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

and

PropDescriptionTypeRequiredDefault Value
showInspectDefaultShow inspect mode by defaultbooleanfalsefalse
useInspectStyleUse inspect style for layersbooleanfalsetrue
showInspectMapPopupShow popup for inspected featuresbooleanfalsetrue
showInspectMapPopupOnHoverShow popup on hoverbooleanfalsefalse
showMapPopupShow generic map popupbooleanfalsefalse
showMapPopupOnHoverShow map popup on hoverbooleanfalsetrue
blockHoverPopupOnClickBlock hover popup on clickbooleanfalsefalse
buildInspectStyleCustom style builder functionFunctionfalsegenerateInspectStyle
backgroundColorBackground color for inspect stylestringfalse'#fff'
assignLayerColorFunction to assign color to layersFunctionfalsebrightColor
renderPopupFunction to render popup contentFunctionfalse_renderPopup
selectThresholdPixel threshold for feature selectionnumberfalse5
queryParametersParameters for querying rendered featuresobjectfalse() => ({})

Slots

NameDescription
defaultCustom content slot

Usage Notes

  • Use inside a <Map> component from @hungpvq/vue-map-core.
  • Useful for debugging and analyzing map layers and features.
  • Highly customizable via props for popup rendering and style.
  • Supports slot for custom UI extension.

Usage

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

<template>
  <Map>
    <InspectControl />
  </Map>
</template>