Commit 455a9591 authored by Fawad Mirzad's avatar Fawad Mirzad
Browse files

Remove outdated informations

parent 6cb357d4
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
export function createMapScript(options) {
  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') {
    throw new Error('options should  be an object')
  }
@@ -15,14 +10,12 @@ export function createMapScript(options) {
    options.libraries = options.libraries.join(',')
  }
  options['callback'] = 'vueGoogleMapsInit'
  let baseUrl = 'https://maps.googleapis.com/'
  let baseUrl = 'https://maps.googleapis.com/maps/api/js?'

  let url =
    baseUrl +
    'maps/api/js?' +
    Object.keys(options)
      .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(options[key]))
      .join('&')
      .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(options[key])).join('&')

  googleMapScript.setAttribute('src', url)
  googleMapScript.setAttribute('async', '')