通过高德地图 JS API实现单击鼠标进行标注

时间:2024-07-09 22:48:22

效果图:

核心代码:

<template>
  <a-modal title="选择地图所在位置" :width="width" :visible="visible" @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <div class="location-map-box">
      <div class="map-box" id="locationMap"></div>
      <a-input class="location-map-search-box" id="tipinput" v-model:value="value" addon-before="关键字:" />
      <div v-if="latitude" class="map-location-box">{
  { longitude + ',' + latitude }}</div>
    </div>
  </a-modal>
</template>

<script lang="ts" setup>
  import A