Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/utils/APILoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ let mainPromise = null
let amapuiPromise = null
let amapuiInited = false
export default class APILoader {
constructor({ key, useAMapUI, version, protocol }) {
constructor({ key,callback, useAMapUI, version, protocol }) {
this.config = { ...DEFAULT_CONFIG, useAMapUI, protocol }
if (typeof window !== 'undefined') {
if (key) {
this.config.key = key
} else if ('amapkey' in window) {
this.config.key = window.amapkey
}
if (callback) {
this.config.callback = callback
}
}
if (version) {
this.config.v = version
Expand Down