Title in Leaflet Map

3,879 views
Skip to first unread message

Abdullah

unread,
Nov 14, 2020, 1:52:04 PM11/14/20
to Leaflet
Hello Everyone,

Its me again with another simple and compilated question:-). Is there a way to add a title to Leaflet Map. I searched a lot in the leaflet documentation and as well as on Stack-Overflow, but I could not find something purely done in Leaflet. I found an example that they use R-Leaflet. I can add it through HTML, but I want something on the map, not out side the map box. Here is the screenshot where I want the title to be.

Thanks everyone!
Abdullah

Inline image




Edwin Corrigan

unread,
Nov 16, 2020, 4:45:59 AM11/16/20
to leafl...@googlegroups.com
Hello Abdullah, 

There is some information, with example, of a potentially valid approach here, with a code example. I think you can use CSS to position your new 'title' Control where you would like it to be - https://stackoverflow.com/questions/33767463/overlaying-a-text-box-on-a-leaflet-js-map

An advantage here is that you can use event handlers (if it ever becomes useful to add functionality to the title :) )  - https://stackoverflow.com/questions/28316273/mapbox-map-styling-for-description-box/28319456#28319456

Best, 
Edwin

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/2005963565.2263554.1605379911657%40mail.yahoo.com.



Reply all
Reply to author
Forward
0 new messages