-
-
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
Nuxt example and click to open infowindow #106
Comments
@GerritKuilder thank you. we will check this. |
Same issue without nuxt. Clicking on a marker doesn't do anything. The click event callback is never executed. |
@ribrewguy did you check in your demo code here? |
The code should look like this: <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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I needed to fix a small typo in the nuxt example that was on the page, after that the map loaded find
There was a capital I in WIndowcontext
But I still can't get the infowindow to work, I added a console.log in the click function, this shows me the click does not work at all.
Kind Regards,
Gerrit Kuilder
The text was updated successfully, but these errors were encountered: