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
Param | Type | Description |
---|---|---|
resolveFn | function | the function that indicates to the plugin that Google Maps is loaded |
customCallback | function | the 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
Param | Type | Description |
---|---|---|
googleMapsApiInitializer | function | function that initialize the Google Maps API |
GoogleMapsApi | Object | Vue 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
Param | Type | Default | Description |
---|---|---|---|
options | Object | undefined | configuration object to initialize the GmapVue plugin | |
options.dynamicLoad | boolean | false | load the Google Maps API dynamically, if you set this to true the plugin doesn't load the Google Maps API |
options.installComponents | boolean | true | install all components |
options.autoBindAllEvents | boolean | false | auto bind all Google Maps API events |
options.load | Object | undefined | options to configure the Google Maps API | |
options.load.key | string | your Google Maps API key | |
options.load.libraries | string | "places" | the Google Maps libraries that you will use eg: 'places,drawing,visualization' |
options.load.v | string | undefined | the Google Maps API version, default latest | |
options.load.callback | string | 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.customCallback | string | undefined | This 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