效果图:
核心代码:
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from 'vue';
import AMapLoader from '@amap/amap-jsapi-loader';
import redImage from '@/assets/images/red.png';
import orangeImage from '@/assets/images/orange.png';
import yellowImage from '@/assets/images/yellow.png';
let map = null;
let map_opt = [
{
city: '西陵区',
color: '#0BACFF',
},
{
city: '伍家岗区',
color: '#FFE720',
},
{
city: '夷陵区',
color: '#502954',
},
{
city: '猇亭区',
color: '#1AB361',
},
{
city: '兴山县',
color: '#5251D0',
},
{
标签:city,assets,color,JS,API,images,import,高德,png
From: https://blog.csdn.net/qq_35366269/article/details/140973466