Newer
Older
Ruby / Leaflet_sub.html
    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="UTF-8">
      <title>B-ハウス</title>
      <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.0/dist/leaflet.css" />
      <script src="https://unpkg.com/leaflet@1.3.0/dist/leaflet.js"></script>
      <script>
        function init() {
          //地図を表示するdiv要素のidを設定
          var map = L.map('mapcontainer');
          //地図の中心とズームレベルを指定
          map.setView([35.40, 136], 5);
          //表示するタイルレイヤのURLとAttributionコントロールの記述を設定して、地図に追加する
          L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
              attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>地理院タイル</a>"
          }).addTo(map);
        }
      </script>
    </head>
    <body onload="init()">
      <div id="mapcontainer" style="width:600px;height:600px"></div>
    </body>
    </html>