vue2-google-heatmap
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "vue2-google-heatmap", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Vue Heatmap component that uses Google Maps", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
## Installation | ||
```js | ||
yarn add vue-google-heatmap | ||
```sh | ||
npm install vue2-google-heatmap --save | ||
``` | ||
You will need an Google Maps Javascript API Key. You can get one here: [Google Cloud Console](https://console.cloud.google.com/) | ||
and | ||
```js | ||
import VueGoogleHeatmap from 'vue-google-heatmap'; | ||
Vue.use(VueGoogleHeatmap, { | ||
apiKey: API_KEY_HERE | ||
}); | ||
import VueGoogleHeatmap from 'vue2-google-heatmap'; | ||
Vue.use(VueGoogleHeatmap); | ||
``` | ||
or if you have Google Maps API already loaded just ignore `apiKey` property | ||
## Important | ||
> #### Be sure that the Google Maps API was loaded and initialised before the component | ||
```js | ||
import VueGoogleHeatmap from 'vue-google-heatmap'; | ||
Vue.use(VueGoogleHeatmap); | ||
``` | ||
## Example | ||
```vue | ||
<template> | ||
<vue-google-heatmap :points="points" | ||
:width="400" | ||
:height="350" /> | ||
<vue-google-heatmap :points="points" :width="400" :height="350" /> | ||
</template> | ||
@@ -30,0 +21,0 @@ |
import VueGoogleHeatmap from './VueGoogleHeatmap.vue'; | ||
import Loader from './loader.js'; | ||
VueGoogleHeatmap.install = function(Vue, options = {}) { | ||
Vue.component(VueGoogleHeatmap.name, VueGoogleHeatmap); | ||
if (typeof options.apiKey !== 'undefined') { | ||
Loader.load(options.apiKey); | ||
} | ||
}; | ||
export default VueGoogleHeatmap; |
Sorry, the diff of this file is not supported yet
4153
5
23
59