D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
wboykinm
Full window
Github gist
Bjorn's Mask Plugin for Leaflet
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Leaflet Mask</title> <link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css" /> <style type="text/css"> html, body, #map { width: 100%; height: 100%; margin: 0; background: #fff; } </style> </head> <body> <div id="map"></div> <script src="https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js"></script> <script type="text/javascript" src="L.Mask.js"></script> <script type="text/javascript"> var map = L.map('map').setView([59.91, 10.65], 10); L.tileLayer('https://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png', { attribution: 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, under <a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.' }).addTo(map); L.mask([[59.81, 10.3], [59.99, 11]]).addTo(map); </script> </body> </html>
https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js