From 20ed3b225a4d5c2174237a434b397a89e0a638ea Mon Sep 17 00:00:00 2001 From: ZvonimirSun Date: Tue, 5 Mar 2024 16:26:32 +0800 Subject: [PATCH] =?UTF-8?q?chore(mapUtils):=20=E4=BD=BF=E7=94=A8=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/mapUtils.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/mapUtils.ts b/src/utils/mapUtils.ts index 9a876a2e..7ba4dcf4 100644 --- a/src/utils/mapUtils.ts +++ b/src/utils/mapUtils.ts @@ -2,15 +2,13 @@ import 'leaflet/dist/leaflet.css' import type { Control, ControlPosition, Map, MapOptions, TileLayer } from 'leaflet' import { Icon, LatLng, control, layerGroup, map } from 'leaflet' -import markerShadow from 'leaflet/dist/images/marker-shadow.png' -import markerIcon from 'leaflet/dist/images/marker-icon.png' -import markerIcon2x from 'leaflet/dist/images/marker-icon-2x.png' +import config from '@/config' import { ChineseLayer, chineseLayer } from '@/utils/leaflet.ChineseLayer.js' import $axios from '@/plugins/Axios' -Icon.Default.prototype.options.iconUrl = markerIcon -Icon.Default.prototype.options.iconRetinaUrl = markerIcon2x -Icon.Default.prototype.options.shadowUrl = markerShadow +Icon.Default.prototype.options.iconUrl = `https://jsdelivr.${config.cdnHost}/gh/zvonimirsun/leaflet-color-markers@master/img/marker-icon-blue.png` +Icon.Default.prototype.options.iconRetinaUrl = `https://jsdelivr.${config.cdnHost}/gh/zvonimirsun/leaflet-color-markers@master/img/marker-icon-2x-blue.png` +Icon.Default.prototype.options.shadowUrl = `https://jsdelivr.${config.cdnHost}/gh/zvonimirsun/leaflet-color-markers@master/img/marker-shadow.png` interface InitMapOptions { dom: HTMLDivElement