Skip to content

Commit

Permalink
fix(gmap-vue): fix error loading cluster
Browse files Browse the repository at this point in the history
Close: #234
  • Loading branch information
diegoazh committed Feb 9, 2022
1 parent 8036263 commit a2cb9ba
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
50 changes: 29 additions & 21 deletions packages/documentation/docs/.vuepress/components/eg-marker.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
<template>
<div>
<gmap-map :center="center" :zoom="7" style="width: 100%; height: 500px">
<gmap-marker v-for="m in markers" :position="m.position" :clickable="true" :draggable="true" @click="center=m.position"></gmap-marker>
<gmap-marker
v-for="(value, index) of markers"
:key="index"
:position="m.position"
:clickable="true"
:draggable="true"
@click="center = m.position"
></gmap-marker>
</gmap-map>
</div>
</template>

<script>
export default {
name: 'eg-marker',
data () {
name: "eg-marker",
data() {
return {
center: {
lat: 10.0,
lng: 10.0
lng: 10.0,
},
markers: [{
position: {
lat: 10.0,
lng: 10.0
}
}, {
position: {
lat: 11.0,
lng: 11.0
}
}]
}
markers: [
{
position: {
lat: 10.0,
lng: 10.0,
},
},
{
position: {
lat: 11.0,
lng: 11.0,
},
},
],
};
},
methods: {}
}
methods: {},
};
</script>

<style scoped>
</style>
<style scoped></style>
7 changes: 5 additions & 2 deletions packages/documentation/docs/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ export default ({
siteData, // site metadata
}) => {
Vue.use(GmapVue, {
key: "AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc",
libraries: "places",
load: {
key: "AIzaSyDf43lPdwlF98RCBsJOFNKOkoEjkwxb5Sc",
libraries: "places",
},
installComponents: true,
});

Vue.component(
Expand Down
7 changes: 3 additions & 4 deletions packages/gmap-vue/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import MountableMixin from './mixins/mountable';
* Therefore we use babel-plugin-transform-inline-environment-variables to
* set BUILD_DEV to truthy / falsy
*/
const Cluster =
process.env.BUILD_DEV === '1'
? undefined
: ((s) => s.default || s)(require('./components/cluster-icon.vue'));
const Cluster = ((s) => s.default || s)(
require('./components/cluster-icon.vue')
);

// TODO: This should be checked if it must be GmapVue, Gmap.api or something else
let GmapApi = null;
Expand Down

0 comments on commit a2cb9ba

Please sign in to comment.