Remove outdated informations
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
export function createMapScript(options) {
|
export function createMapScript(options) {
|
||||||
const googleMapScript = document.createElement('SCRIPT')
|
const googleMapScript = document.createElement('SCRIPT')
|
||||||
|
|
||||||
// Allow options to be an object.
|
|
||||||
// This is to support more esoteric means of loading Google Maps,
|
|
||||||
// such as Google for business
|
|
||||||
// https://developers.google.com/maps/documentation/javascript/get-api-key#premium-auth
|
|
||||||
if (typeof options !== 'object') {
|
if (typeof options !== 'object') {
|
||||||
throw new Error('options should be an object')
|
throw new Error('options should be an object')
|
||||||
}
|
}
|
||||||
@@ -15,14 +10,12 @@ export function createMapScript(options) {
|
|||||||
options.libraries = options.libraries.join(',')
|
options.libraries = options.libraries.join(',')
|
||||||
}
|
}
|
||||||
options['callback'] = 'vueGoogleMapsInit'
|
options['callback'] = 'vueGoogleMapsInit'
|
||||||
let baseUrl = 'https://maps.googleapis.com/'
|
let baseUrl = 'https://maps.googleapis.com/maps/api/js?'
|
||||||
|
|
||||||
let url =
|
let url =
|
||||||
baseUrl +
|
baseUrl +
|
||||||
'maps/api/js?' +
|
|
||||||
Object.keys(options)
|
Object.keys(options)
|
||||||
.map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(options[key]))
|
.map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(options[key])).join('&')
|
||||||
.join('&')
|
|
||||||
|
|
||||||
googleMapScript.setAttribute('src', url)
|
googleMapScript.setAttribute('src', url)
|
||||||
googleMapScript.setAttribute('async', '')
|
googleMapScript.setAttribute('async', '')
|
||||||
|
|||||||
Reference in New Issue
Block a user