Skip to content

Commit

Permalink
chore(mapUtils): 使用线上图标
Browse files Browse the repository at this point in the history
  • Loading branch information
ZvonimirSun committed Mar 5, 2024
1 parent d4d7122 commit 20ed3b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/utils/mapUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20ed3b2

Please sign in to comment.