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/03-draw-a-point-on-map.md.
MapxusDeveloper Platform
Products
Positioning APIAccess real-time indoor coordinates and contextual signals.API
UI SDKProduction-ready indoor map interfaces and UI components.AndroidiOS

Draw a Point on Map

To draw a point on the map:

// use maplibre addSource and addLayer function
const sourceId = 'myPoint';
const layerId = sourceId + 'Layer';
const coordinates = [114.16158, 22.30498];
// init maplibre-gl map
const maplibreMap = new maplibregl.Map({
    container: 'map'
});

function addSource() {
  maplibreMap.addSource(sourceId, {
    type: 'geojson',
    data: {
      type: 'Feature',
      geometry: {
        type: 'Point',
        coordinates: coordinates
      }
    }
  });
}
function addLayer() {
  maplibreMap.addLayer({
    id: layerId,
    type: 'circle',
    source: sourceId,
    paint: {
      'circle-radius': 5,
      'circle-color': '#007cbf'
    }
  });
}

Sample web page: