LocPicker 地图选点

封装了腾讯位置服务的地图选点服务组件。

弹窗使用

<template>
<dg-loc-picker @confirm="onConfirm" ref="locPickerRef" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { LocPickerResult } from '@degon/admin-component-vue3'
const locPickerRef = ref()

// 打开弹窗
locPickerRef.value.open()

const onConfirm = (data: LocPickerResult) => {
  // 位置信息
  console.log(data)
}
</script>

以页面方式使用

<template>
<!-- 选择的位置结果在backurl的参数上回调  -->
<dg-loc-picker :type="0" backurl="http://baidu.com" />

<!-- 自定义触发内容 -->
<dg-loc-picker :type="0" backurl="http://baidu.com">
  <template #trigger>
    <el-button size="small" plain type="primary">选择位置</el-button>
  </template>
</dg-loc-picker>
</template>

Attributes

参数类型说明可选值默认值
typenumber0: 以页面跳转的方式调用, 1: 以iframe内嵌页面的弹窗调用0、11
backurlstringtype=0时,回调地址,选择的位置结果在参数上面--
akstring开发密钥(key), 若您的key已设置webservice域名白名单,请在 白名单 中增加地图选点组件域名-'XLBBZ-AZ43K-IGHJZ-AX6K6-AL67S-HAFWN'
refererstring调用来源,一般为您的应用名称,为了保障对您的服务,请务必填写-'alzheimer'
paramsobject其它腾讯地图选点组件的参数,参见open in new window--
titlestring弹窗标题或trigger按钮文字-'选择地址'
heightstringiframe高度-'400px'

Methods

方法名说明参数
open打开弹窗-

Slot

name说明参数
trigger触发跳转到地图选点页面的内容-

Events

事件名说明参数
close弹窗关闭后触发
confirm选择位置确定后触发位置信息LocPickerResult
Last Updated:
Contributors: chwech