Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
Markerclustrerplus style will not center

iam using this npm package

https://github.com/googlemaps/js-markerclustererplus

Iam trying to center the style and this is how.

let clusterStyle = {
            textColor: 'white',
            textSize: 14,
            url: iconBase + 'pin-cluster-store.png',
            width: 45,
            height: 49
        }


let mc = new MarkerClusterer(map,mapMarkers, {
           maxZoom: 15,
           gridSize: 50,
           styles: clusterStyles
});

This is how it looks

marker clustrer

I want it to be center of the circle. Whwn i add padding-top 16px in the console it works fine. But when i add it programatically in the "clusterstyle" nothing happends

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You will need to adjust the anchors. https://googlemaps.github.io/js-markerclustererplus/interfaces/ClusterIconStyle.html

anchorIcon?: [number, number]

The anchor position (in pixels) of the cluster icon. This is the spot on the cluster icon that is to be aligned with the cluster position. The format is [yoffset, xoffset] where yoffset increases as you go down and xoffset increases to the right of the top-left corner of the icon. The default anchor position is the center of the cluster icon.

anchorText?: [number, number]

The position (in pixels) from the center of the cluster icon to where the text label is to be centered and drawn. The format is [yoffset, xoffset] where yoffset increases as you go down from center and xoffset increases to the right of center. The default is [0, 0].

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda