Javascript examples for Leaflet:Polygon
add a html title tooltip to a leaflet.js polygon?
<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 {/* ww w. j av a 2s .co m*/ 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", { sticky: true }).addTo(map); } </script> </head> <body> <div id="map"></div> </body> </html>