For AI agents: the complete documentation index is available at /core-sdk/map/web/llms.txt, the full documentation bundle is available at /core-sdk/map/web/llms-full.txt, and this page is available as Markdown at /core-sdk/map/web/v10/10-markers-annotations/02-create-custom-marker.md.
MapxusDeveloper Platform
Products
Positioning APIAccess real-time indoor coordinates and contextual signals.API
UI SDKProduction-ready indoor map interfaces and UI components.AndroidiOS

Create Custom Marker

To create your custom marker:

// init maplibre-gl map
const maplibreMap = new maplibregl.Map({
	container: 'map'
});
// init mapxus map
const map = new MapxusMap.Map({
	map: maplibreMap,
	appId: "your_appId",
	secret: "your_secret",
	floorId: "2cdd6174730d4431b1aa730eda596ed4",
});

map.rendercomplete(async () => {
	// create marker
	const marker = new MapxusMap.Marker(maplibreMap);
    // set custom marker style
	await marker.setIcon('poi-02');
    // or
    // await marker.setIcon('https://map-service.mapxus.com/bssww/assets/destination-marker.png');
    // marker.setIconSize(0.25);
	marker.create([
		{
			lngLat: [114.1109316, 22.3709052],
            properties: {
				buildingId: 'tsuenwanplaza_hk_369d01',
                ordinal: '0'
			},
            featureId: 1
        },
		{
			lngLat: [114.1113619, 22.3706961],
            properties: {
				buildingId: 'tsuenwanplaza_hk_369d01',
                ordinal: '0'
			},
            featureId: 2
		}
	]);

	// update marker
    marker.updateData({
        remove: [2],
        add: [
			{
                lngLat: [114.12, 22.38],
                properties: {
                    buildingId: 'tsuenwanplaza_hk_369d01',
                    ordinal: '0'
                },
                featureId: 3
            }
        ],
        update: [
            {
	            lngLat: [114.1109316, 22.3709052],
	            properties: {
		            buildingId: 'tsuenwanplaza_hk_369d01',
		            ordinal: '0',
                    greeting: 'Hello World!'
	            },
	            featureId: 1
            }
        ]
    });
});

Sample web page: