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

240
Visualizações
Get Leaflet map tile image for polygon

For a project I need to generate previews of polygons that we store in the backend. A polygon typically has this format: [lat,long]

const polygon = [
    [
        4.329064,
        51.276626
    ],
    [
        4.330755,
        51.276416
    ],
    [
        4.329064,
        51.276626
    ]
]

Screenshot mockup

Polygons

I already found out that I can calculate the center of a polygon with polygon.getBounds().getCenter(); and center the map view there, but I rather not load a new Leaflet map for each and every polygon that is stored in the project :)

Are there easier ways to get a map tile as .PNG for example and reference this in my Angular template or do I really have to render a separate map everytime?

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

0

I found a library that let's me export images of Leaflet maps, which I will store as preview for each polygon.

https://github.com/mapbox/leaflet-image

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