name="viewport" content="initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" href="https://unpkg.com/
[email protected]/dist/leaflet.css" /> <script src="https://unpkg.com/
[email protected]/dist/leaflet.js"></script> <script src="https://frogcat.github.io/leaflet-tilelayer-mask/leaflet-tilelayer-mask.js"></script> </head> <body> <div id="map" style="position:absolute;top:0;left:0;bottom:0;right:0;"></div> <script> var map = L.map("map").setView([35.671872, 139.754969], 18); L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors" }).addTo(map); var layer = L.tileLayer.mask("https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg", { attribution: "<a href='http://maps.gsi.go.jp/development/ichiran.html'>地理院タイル</a>" }).addTo(map); map.on("mousemove", function(event) { layer.setCenter(event.containerPoint); }); </script> </body> </html>