1

is there anyway so i could export the text label using leaflet-image plugin.

I've tried many plugins other than leaflet-label bus it doesn't seems to work

thanks

1 Answers1

1

Is there any way to export text labels using the leaflet-image plugin?

No.

As stated on its documentation:

This library does not rasterize HTML because browsers cannot rasterize HTML. Therefore, L.divIcon and other HTML-based features of a map, like zoom controls or legends, are not included in the output, because they are HTML.

While the statement about "browsers not being able to rasterize HTML" is not entirely true, the leaflet-image plugin does not implement (as of now) any method to rasterize HTML elements containing text. And text labels in Leaflet (unless stated otherwise) are HTML elements.

(On a side note, please be aware that asking a question with a "yes" or "no" answer might get you literally "yes" or "no" for an answer, and if this is not the answer you wanted, you should reformulate your question.)

IvanSanchez
  • 18,272
  • 3
  • 30
  • 45
  • Is there any solution other than using leaflet image? – Houssam Kharbouchi Jul 13 '16 at 13:46
  • The only well-known solutions are the ones at http://leafletjs.com/plugins.html#printexport . There are other approaches, such as using a headless browser (such as phantomjs, or wkhtml2pdf), which are ways of automatically making screenshots of webpages. Those approaches will require more research and work on your part. – IvanSanchez Jul 13 '16 at 14:47