inocan-group / vue3-google-map

A set of composable components for easy use of Google Maps in your Vue 3 projects.
https://vue3-google-map.com
MIT License
264 stars 51 forks source link

open and close infowindow #128

Closed mansour161 closed 11 months ago

mansour161 commented 1 year ago

hi i have two problem . 1- when i have a MarkerCluster and want to select second marker , Infowindow of first marker was not closed automatic 2 - when i want to click into map , Infowindow is not closed

thanks

mansour161 commented 1 year ago

hi plse help me with code

theyokohamalife commented 1 year ago

@HusamIbrahim @yankeeinlondon

Calling the .close() method on the instance of infoWindow by the ref on InfoWindow doesn't seem to be working. Short example:

<template>
<InfoWindow ref="infoWindowRef" />
</template>

<script>
const infoWindowRef= ref(null)

closeInfoWindow() {
  infoWindowRef.value.infoWindow.close() // has no effect
}
</script>
theyokohamalife commented 1 year ago

It looks like there is a PR that's been approved but not merged yet that addresses this issue. Any idea on when it will be released?

https://github.com/inocan-group/vue3-google-map/pull/125

HusamElbashir commented 11 months ago

@HusamIbrahim @yankeeinlondon

Calling the .close() method on the instance of infoWindow by the ref on InfoWindow doesn't seem to be working. Short example:

<template>
<InfoWindow ref="infoWindowRef" />
</template>

<script>
const infoWindowRef= ref(null)

closeInfoWindow() {
  infoWindowRef.value.infoWindow.close() // has no effect
}
</script>

This should work on the lates version v0.16.0. OP's original request for automatically closing info windows isn't supported atm.