This might seem a very simple question, but I've searched elsewhere for the answer with no luck!
How do I overlay a simple text box on to a Leaflet map that loads when the map loads (not fixed to any point on a map) - for example, to give a title and more information within the actual map object. Nothing fancy.
You have two simple options, extend a new L.Control
and place it in one of the four corners of the map window with content created inside the onAdd
method, or place a L.DivIcon
anywhere on the map alongside a L.Marker
, by either geographical coordinates or coordinates based upon the dimensions of the container.Making it "box" like would just include a small bit of CSS as you see fit, like some padding
,background-color
, etc.