Skip to content

Commit

Permalink
fix: 手动传 apiUrl 时 callback 未正确自动携带
Browse files Browse the repository at this point in the history
close #117
  • Loading branch information
yue1123 authored Nov 27, 2024
2 parents 502e6e2 + b3cbb1e commit 1f102ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/map/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,13 @@
? Object.assign(proxy!.$baiduMapPluginsSourceLink, props.pluginsSourceLink)
: props.pluginsSourceLink || proxy!.$baiduMapPluginsSourceLink || {}
const scriptKey = apiUrl ? `_initBMap_` : `_initBMap_${ak}`
const src = apiUrl
? `${apiUrl.replace(/&$/, '')}&callback=${scriptKey}`
: `//api.map.baidu.com/api?type=webgl&v=1.0&ak=${ak}&callback=${scriptKey}`
// load sdk
getScriptAsync({
src: apiUrl ? apiUrl : `//api.map.baidu.com/api?type=webgl&v=1.0&ak=${ak}&callback=${scriptKey}`,
src,
addCalToWindow: true,
key: scriptKey,
exportGetter: () => window.BMapGL
Expand Down

0 comments on commit 1f102ec

Please sign in to comment.