指南针控件(NavigationControl)
导航控件组件,包括缩放按钮和一个指南针.
示例
示例源码
vue
<template>
<div style="height: 400px" class="vw-full vh-full">
<mb-map :bearing="30">
<mb-tianditu-layer />
<mb-navigation-control
:show-compass="true"
:show-zoom="true"
position="top-right"
/>
</mb-map>
</div>
</template>
<script setup lang="ts"></script>API
PROPS
| 名称 | 描述 | 类型 | 默认值 |
|---|---|---|---|
| position | 控件所处位置 | string('top-left' , 'top-right' , 'bottom-left' ,'bottom-right') | top-right |
| show-compass | 是否显示指南针 | boolean | true |
| show-zoom | 是否显示放大缩小按钮 | boolean | true |
EVENTS
| 名称 | 描述 | 参数 |
|---|---|---|
| created | 地图初始化完成事件 | - |
SLOTS
| 名称 | 描述 |
|---|
METHODS
| 名称 | 描述 | 定义 |
|---|
