一、在index.html文件中引入高德地图JavaScript API的2.0版本SDK
<script src="https://webapi.amap.com/maps?v=2.0&key=你的高德地图Key"></script>
二、创建一个Vue组件,用于渲染地图和点位
html
<template>
<div class="map-container">
<div id="map" class="map"></div>
<div class="checkbox-container">
<label v-for="(type, index) in types" :key="index">
<input type="checkbox" :value="type" v-model="selectedTypes" @change="toggleMarkers">
{
{
type }}
</label>
</div>
</div>