How does one turn on and off a marker animation after the user clicks on a marker (for the library vue-google-maps)?
https://github.com/fawmi/vue-google-maps
This is what I have so far:
<template>
<GMapMap
:center="center"
:zoom="7"
map-type-id="terrain"
style="width: 500px; height: 300px"
>
<GMapMarker
:key="index"
v-for="(marker, index) in markers"
:position="marker.position"
:clickable="true"
:animation="marker.animation"
@click="clickedMarker(index)"
/>
</GMapMap>
</template>
<script setup lang="ts">
let center = { lat: 51.093048, lng: 6.842120 };
let markers = [{animation: 0, "position":{ lat: 51.093048, lng: 6.842120 }}];
const clickedMarker = (index: number) => {
if (markers[index].animation === 0) {
markers[index].animation = 1;
} else {
markers[index].animation = 0;
}
};
</script>