<!doctype html>
<html>
<head>
<title>Init Map By Building ID</title>
<meta charset="utf-8" />
<link
href="https://unpkg.com/maplibre-gl@5.2.0/dist/maplibre-gl.css"
rel="stylesheet"
/>
<link
href="https://web-sdk.mapxus.com/prod/mapxus-map-10.2.1.css"
rel="stylesheet"
/>
<style>
html,
body,
#map {
height: 100%;
}
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<!-- SDK scripts -->
<script src="https://unpkg.com/maplibre-gl@5.2.0/dist/maplibre-gl.js"></script>
<script src="https://web-sdk.mapxus.com/prod/mapxus-auth-0.1.2.js"></script>
<script src="https://web-sdk.mapxus.com/prod/mapxus-map-10.2.1.js"></script>
<script>
const { maplibregl, MapxusAuth, MapxusMap } = window;
// register mapxus auth
MapxusAuth.registerWithApiKey("your_appId", "your_secret");
// create map view
const maplibreMap = new maplibregl.Map({
container: "map",
zoom: 17,
});
// init mapxus map
const map = new MapxusMap.Map({
map: maplibreMap,
buildingId: "tsuenwanplaza_hk_369d01",
});
// mapxus map loaded listener
map.renderComplete(function () {});
</script>
</body>
</html>