Leftlet Samples

by LandsD Map API

HTML

<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css">
<div id="mapid"></div>

CSS

html, body{
  height:100%;
  width:100%;
}
#mapid {
  height:100%;
  width:100%;
}

JavaScript

var apikey = 'f4d3e21d4fc14954a1d5930d4dde3809';
var map = L.map('mapid').setView([22.29227, 114.20847], 16);

L.tileLayer('https://landsd.azure-api.net/tileservices/basemap/WGS84/2017/{z}/{x}/{y}.png?key=' + apikey, {
  attribution: '<a href="https://mapapis01.blob.core.windows.net/info/disclaimer.html"  target="_blank">&copy;Lands Department, HKSARG</a>',
  maxZoom: 19,
}).addTo(map);

L.tileLayer('https://landsd.azure-api.net/tileservices/label/WGS84/2017/tc/{z}/{x}/{y}.png?key=' + apikey, {
  attribution: '<a href="https://mapapis01.blob.core.windows.net/info/disclaimer.html"  target="_blank">&copy;Lands Department, HKSARG</a>',
  maxZoom: 19,
}).addTo(map);