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
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?