We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to call map action on the event of marker click, there is no errors in console, but action doesn't happen, my code example is:
<template> <div id="q-map"> <MglMap :mapStyle="mapStyle" :center="[filtItems[selectedID].longitude, filtItems[selectedID].latitude]" :zoom="14" ref="map"> <MglMarker v-for="(item, idx) in filtItems" :key="idx" :coordinates="[item.longitude, item.latitude]"> <div slot="marker" :id="item.name" @click="pinSelected(idx)"> </div> </MglMarker> </MglMap> </div> </template> <script> export default { methods: { async pinSelected (idx) { var me = this me.$refs.map.map.panTo({ coordinates: [30, 30] }) } } } </script>
The text was updated successfully, but these errors were encountered:
Found my bug and working solution !!!
So, I have to remove prop center from <template> at all and instead of panTo I tried flyTo, here is my working code:
center
<template>
panTo
flyTo
<template> <div id="q-map"> <MglMap :mapStyle="mapStyle" :zoom="14" ref="map"> <MglMarker v-for="(item, idx) in filtItems" :key="idx" :coordinates="[item.longitude, item.latitude]"> <div slot="marker" :id="item.name" @click="pinSelected(idx)"> </div> </MglMarker> </MglMap> </div> </template> <script> export default { methods: { pinSelected (idx) { var me = this me.$refs.map.map.flyTo({ center: [30, 30] }) } } } </script>
Sorry, something went wrong.
No branches or pull requests
I'm trying to call map action on the event of marker click, there is no errors in console, but action doesn't happen, my code example is:
The text was updated successfully, but these errors were encountered: