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

111
Visualizações
Leaflet marker clusters based on geographic constraints and custom icons?

I'm trying to create a map that would have marker clusters based on geographic restrictions. For example a cluster for the country that would contain all the marker clusters of the regions of the country, the regions would contain provinces, provinces municipalities and so on.

This website is a good example of what I'm trying to achieve: https://laruchequiditoui.fr/fr/assemblies#5/46.655/2.659

The data I have is stored in JSON, divided by Levels,

 Level_0 (highest - country) :{
   level_1 (regions), 
   level_2 (districts), ... 
   level_n(lowest- towns/municipalities, etc.)
}

Each item in the level has a property of the administrative division above it, that it belongs to, so I wouldn't need to cluster them based on borders eg. geojson, I just need to associate the items to group into a certain cluster based on that value and not based on distance.

I was thinking about creating a cluster for each individual region, province, etc. but I don't think that's a good way of doing as some countries have thousands of divisions + I'm not sure how I'd even create them dynamically for every country and division.

The other thing that I'm trying to do is to have the marker clusters display the flags of the current region. For example top marker cluster fof the country would have an icon for the flag of the country, when zoomed in the regions would have an icon with the flag of the region, etc. etc.

I'd really appreciate some pointers on how to get started with this, I haven't had much luck finding anything online except a deleted Github thread about this exact issue and I've been stuck on it for weeks.

about 4 years ago · Juan Pablo Isaza
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