-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help please, the InfoWindows does't work #123
Comments
Hello, good afternoon, I am trying to use the Infowindows component, but when clicking on the marker, it does not perform any action, nor does it return any error |
@wecodexoficial did you check our demo code in readme? |
@chantouchsek Thanks for your reply |
@wecodexoficial can you show me you code, that you implemented? the event name should one of below:
|
@wecodexoficial did you try the code below? <template lang="html">
<div class="info-windows">
<google-map id="map" ref="Map">
<google-map-marker
:key="index"
v-for="(info, index) in infoWindowsList"
:position="info.position"
@click="toggleInfoWindow(info)"
/>
<google-map-infowindow
v-for="(info, index) in infoWindowsList"
:key="`info-window-${index}`"
:position="info.position"
:show.sync="showInfo"
:options="{maxWidth: 300}"
@info-window-clicked="infoClicked($event, info)"
>
<h4 >{{infoWindowContext.title}}</h4>
<p>{{infoWindowContext.description}}</p>
</google-map-infowindow>
</google-map>
</div>
</template>
<script>
import cities from '../assets/cities.json'
export default {
data () {
return {
showInfo: true,
infoWindowContext: {
title: 'Hello world',
description: 'Description',
position: {
lat: 44.2899,
lng: 11.8774
}
},
infoWindowsList: cities
}
},
methods: {
toggleInfoWindow (context) {
this.infoWindowContext = context
this.showInfo = true
},
infoClicked(context, spot) {
console.log('infoClicked', context, spot)
}
}
}
</script>
|
No description provided.
The text was updated successfully, but these errors were encountered: