Javascript examples for Leaflet:Configuration
Bindtooltip on hover and permanent in leaflet
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://npmcdn.com/leaflet@1.0.0-rc.3/dist/leaflet-src.js"></script> <link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet@1.0.0/dist/leaflet.css"> <script type="text/javascript" src="https://unpkg.com/leaflet@1.0.0/dist/leaflet.js"></script> <style id="compiled-css" type="text/css"> #map {// www . j av a 2 s .com height: 500px; } </style> <script type="text/javascript"> window.onload=function(){ var map = L.map("map"); L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map); map.setView([48.85, 2.35], 12); L.rectangle([[48.84, 2.34], [48.86, 2.36]]).bindTooltip("test", { permanent: true }).addTo(map); L.rectangle([[48.84, 2.34], [48.86, 2.36]]).bindTooltip("hello", { permanent: false }).addTo(map); } </script> </head> <body> <div id="map"></div> </body> </html>