map-element
mapElementMixin
MapElementMixin
Add a inject object to inject $mapPromise and a provide function to the component this function save the returned Google Maps object in the $map property after the $mapPromise is resolved.
The mixin code
  export default {
    inject: {
      $mapPromise: { default: 'abcdef' },
    },
    provide() {
      this.$mapPromise.then((map) => {
        this.$map = map;
      });
      return {};
    },
  };
Kind: global class
Properties
| Name | Description | 
|---|---|
| $mapPromise | The map property that should return the $map.Note: although this mixin is not "providing" anything, components' expect the $mapproperty to be present on the component.           In order for that to happen, this mixin must intercept the$mapPromise           .then(() => )first before its component does so.           Since aprovide()on a mixin is executed before aprovide()on the           component, putting this code inprovide()ensures that the$mapis           already set by the time the component'sprovide()is called. | 
| $map | The Google map (valid only after the promise ( $mapPromise) returns) |