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/12-switch-venue-or-building-or-floor.md.
MapxusDeveloper Platform
Products
Positioning APIAccess real-time indoor coordinates and contextual signals.API
UI SDKProduction-ready indoor map interfaces and UI components.AndroidiOS

Switch Venue, Building, or Floor

Change Indoor Selected States

Three functions provided to change indoor map selected states: selectVenueById(), selectBuildingById(), selectFloorById() and selectSharedFloorById().

  • selectVenueById(venueId, {dragPan?, animate?, fitBounds?}?): Locate indoor by selecting venue, displays the venue's history/default_displayed/first building of building_ids. Then select the historical visited floor or default_displayed_floor or the floor which ordinal equals 0 of the displayed building. With {dragPan: true}/{dragPan: false} to enable/disable map panning, "dragPan" is true by default. 'venueId' can be 'null', then map will exit indoors; With {animate: true}/{animate: false} to enable/disable map panning with animation, default setting is animate: true. And {fitBounds: true}/{fitBounds: false} to enable/disable the map view fit the selecting venue bounds.
  • selectBuildingById(buildingId, {dragPan?, animate?, fitBounds?}?): Locate indoor by selecting building, displays the specified building. Select the historical visited floor or default_displayed_floor or the floor which ordinal equals 0.
  • selectFloorById(floorId, {dragPan?, animate?, fitBounds?}?): Locate indoor by selecting floor, displays the specified floor[and the building, venue it belongs to].
  • selectSharedFloorById(sharedFloorId, {dragPan?, animate?, fitBounds?}?): Locate indoor by selecting shared floor, displays the specified sharedFloor[and venue it belongs to]. Use Tips: Just choose one of the methods to call based on your scene requirements.
// mapxus load map listener
map.renderComplete(function() {
  // map.selectVenueById(venueId);
  // map.selectBuildingById(buildingId);
  // map.selectFloorById(floorId);
  // map.selectSharedFloorById(sharedFloorId);
});