Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda