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 minimumClusterSize property not working #47

Open
RensBoeser opened this issue Jan 26, 2023 · 2 comments
Open

Cluster minimumClusterSize property not working #47

RensBoeser opened this issue Jan 26, 2023 · 2 comments
Assignees
Labels
advise or question Seeking for advise or question good first issue Good for newcomers

Comments

@RensBoeser
Copy link

Just switched from the original vue google maps library and I noticed my clusters were different. This is because both styles and miunimum-cluster-size properties were not working. I fixed the styles by writing my own render function, but how do I fix my minimum-cluster-size?

My code:

<template>
  <g-map-cluster
    :renderer="{ render }"
    :zoom-on-click="true"
    :minimum-cluster-size="6"
  >
    <slot />
  </g-map-cluster>
</template>

<script setup lang="ts">
const render = ({ count, position }: any) => {
  return new google.maps.Marker({
    icon: { url: '/clusters/m1.png', scaledSize: new google.maps.Size(48, 48) },
    label: { text: String(count), color: 'white' },
    position,
    zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,
  })
}
</script>

What were your expecting to happen?
minimum cluster size set to 6

What happened?
minimum cluster size set to 2 (default)

@NathanAP
Copy link
Owner

Hello! Sorry for the delay on answering you.

Our cluster was changed by some PRs if you compare to the original one, thats the probably reason to be different. We could test adding minimumClusterSize to its props to see if it would work for you.

@NathanAP NathanAP added good first issue Good for newcomers advise or question Seeking for advise or question labels Jan 27, 2023
@NathanAP NathanAP self-assigned this Jan 27, 2023
@rabume
Copy link

rabume commented Aug 4, 2023

This is how you can archive it now:

<GMapCluster :algorithm="algorithm">
</GMapCluster>

<script setup lang="ts">
const algorithm = new SuperClusterAlgorithm({
    minPoints: 6,
    minZoom: 5,
    radius: 400
})
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advise or question Seeking for advise or question good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants