[go: nahoru, domu]

Skip to content
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

Cluster icon moves with the map when panning #122

Closed
pokhrelashok opened this issue May 8, 2022 · 4 comments
Closed

Cluster icon moves with the map when panning #122

pokhrelashok opened this issue May 8, 2022 · 4 comments

Comments

@pokhrelashok
Copy link

When using marker cluster, when panning the map the cluster icon also pans along.

Expected behavior
The cluster icon stays when the markers originally were.

Screenshots
The cluster icon where it should be
image

On panning the map to a different location, the cluster icon pans along with the maps and moves.
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Google Chrome
  • Version 101.0.4951.54

Additional context
Code
<GMapMap :options="options" :center="mapStore.currentPosition" :zoom="7" class="w-100 h-100"> <GMapCluster :styles="mapClusterStyles"> <GMapMarker v-for="(m, index) in markers" :key="index" :position="m.position" :clickable="true" :icon="'/images/map-marker.png'" @click="onMarkerClick(m)" > <GMapInfoWindow :closeclick="true" :opened="openedMarkerID === m.id" @closeclick="setOpenedMarker(null)" > <LocationInfo></LocationInfo> </GMapInfoWindow> </GMapMarker> </GMapCluster> </GMapMap >
@fawmi/vue-google-maps version "^0.9.7",

@fawmi
Copy link
Owner
fawmi commented May 17, 2022

@pokhrelashok
Can you elaborate the problem using a gif or a screen recording? I can't follow exactly what problem you are having.

@pokhrelashok
Copy link
Author
pokhrelashok commented May 20, 2022

@emanday
Copy link
emanday commented Jun 16, 2022

@pokhrelashok I had the same problem, my solution was to use width and height for cluster styles:

<GMapCluster :styles="myClusterStyles">
const myClusterStyles = [{ textColor: #000, url: 'my/url/icon.svg', width: 20, height: 20 }]

Then the cluster was not moving along with the map.

@pokhrelashok
Copy link
Author

@emanday yup it works! Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants