Create Marker
To create marker[s] on map:
Set markers' opacity by building(or venue, Refer API) and ordinal:
To add a marker event listener:
Sample web page:
To create marker[s] on map:
// init maplibre-gl map
const maplibreMap = new maplibregl.Map({
container: "map",
});
// create marker
const marker = new MapxusMap.Marker(maplibreMap);
marker.create([
{
lngLat: [114.1109316, 22.3709052],
properties: { buildingId: "tsuenwanplaza_hk_369d01", ordinal: "0" },
},
{
lngLat: [114.1113619, 22.3706961],
properties: { buildingId: "tsuenwanplaza_hk_369d01", ordinal: "0" },
},
]);Set markers' opacity by building(or venue, Refer API) and ordinal:
map.onMapChangeListener(({ building, floor }) => {
marker.setOpacityByBuilding(building?.properties?.id, floor.ordinal, 0.5);
});To add a marker event listener:
// marker on click event
marker.on("click", (marker) => {
// do something
});Sample web page:

