Skip to main content

promise-lazy

Functions

createCallbackAndChecksIfMapIsLoaded(resolveFn, customCallback)

This function allow to auto detect an external load of the Google Maps API or load it dynamically from our component.

getPromiseLazyCreatorFn(googleMapsApiInitializer, GoogleMapsApi)function

This function is a factory of the promise lazy creator it helps you creating the function that will call the Google Maps API in an async way

createCallbackAndChecksIfMapIsLoaded(resolveFn, customCallback)

This function allow to auto detect an external load of the Google Maps API or load it dynamically from our component.

Kind: global function

ParamTypeDescription
resolveFnfunctionthe function that indicates to the plugin that Google Maps is loaded
customCallbackfunctionthe custom callback to execute when the plugin load. This option will be removed on the next major release

getPromiseLazyCreatorFn(googleMapsApiInitializer, GoogleMapsApi) ⇒ function

This function is a factory of the promise lazy creator it helps you creating the function that will call the Google Maps API in an async way

Kind: global function

ParamTypeDescription
googleMapsApiInitializerfunctionfunction that initialize the Google Maps API
GoogleMapsApiObjectVue instance that will help to know if the google API object is ready

getPromiseLazyCreatorFn~promiseLazyCreator(options)

The creator of the lazy promise

Kind: inner method of getPromiseLazyCreatorFn

ParamTypeDefaultDescription
optionsObject | undefinedconfiguration object to initialize the GmapVue plugin
options.dynamicLoadbooleanfalseload the Google Maps API dynamically, if you set this to true the plugin doesn't load the Google Maps API
options.installComponentsbooleantrueinstall all components
options.autoBindAllEventsbooleanfalseauto bind all Google Maps API events
options.loadObject | undefinedoptions to configure the Google Maps API
options.load.keystringyour Google Maps API key
options.load.librariesstring"places"the Google Maps libraries that you will use eg: 'places,drawing,visualization'
options.load.vstring | undefinedthe Google Maps API version, default latest
options.load.callbackstring | undefined"GoogleMapsCallback"This must be ignored if have another callback that you need to run when Google Maps API is ready please use the customCallback option.
options.load.customCallbackstring | undefinedThis option was added on v3.0.0 but will be removed in the next major release. If you already have an script tag that loads Google Maps API and you want to use it set you callback in the customCallback option and our GoogleMapsCallback callback will execute your custom callback at the end; it must attached to the window object, is the only requirement.

promiseLazyCreator~onMapsReady() ⇒ Object

Things to do once the API is loaded

Kind: inner method of promiseLazyCreator
Returns: Object - the Google Maps API object