Skip to content

Commit

Permalink
fix: 修复 mapvThree cdn 地址错误
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Dec 16, 2022
1 parent b62ea85 commit 00164f9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/utils/pluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import getScriptAsync from './getScriptAsync'

export type PluginsList = ['TrackAnimation', 'Mapvgl', 'Mapv', 'MapvglThree']
export type PluginsList = ['TrackAnimation', 'Mapvgl', 'Mapv', 'MapvThree']
export type PluginsUnion = PluginsList[number]
export type PluginsSourceLink = Record<PluginsUnion, string>
export type PluginsLoader = (...args: any[]) => Promise<any>
Expand All @@ -12,7 +12,7 @@ export const DEFAULT_PLUGINS_SOURCE_LINK: PluginsSourceLink = {
TrackAnimation: '//mapopen.bj.bcebos.com/github/BMapGLLib/TrackAnimation/src/TrackAnimation.min.js',
Mapvgl: 'https://code.bdstatic.com/npm/[email protected]/dist/mapvgl.min.js',
Mapv: 'https://mapv.baidu.com/build/mapv.min.js',
MapvglThree: 'https://code.bdstatic.com/npm/mapvgl@1.0.0-beta.159/dist/mapvgl.threelayers.min.js'
MapvThree: 'https://unpkg.com/mapv-three@1.0.1/dist/mapvthree.umd.js'
} as const

export const pluginLoaderMap: Record<PluginsUnion, (customSourceLink?: string) => Promise<any>> = {
Expand All @@ -34,11 +34,11 @@ export const pluginLoaderMap: Record<PluginsUnion, (customSourceLink?: string) =
addCalToWindow: false,
key: 'Mapv'
}),
MapvglThree: (customSourceLink?: string) =>
MapvThree: (customSourceLink?: string) =>
getScriptAsync({
src: customSourceLink || DEFAULT_PLUGINS_SOURCE_LINK['MapvglThree'],
src: customSourceLink || DEFAULT_PLUGINS_SOURCE_LINK['MapvThree'],
addCalToWindow: false,
key: 'MapvglThree'
key: 'MapvThree'
})
}

Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00164f9

Please sign in to comment.