# Mappedin React SDK > React components and hooks for building indoor mapping applications with Mappedin - React components: MapView, Marker, Label, Path, Shape, Model, Navigation - Hooks: useMap, useMapData, useMapViewEvent, useMapDataEvent - Built on @mappedin/mappedin-js with full TypeScript support ## Understanding Data Sources This SDK supports two data sources. **You MUST identify which one applies before writing code.** ### Maker Data Source - **Credentials**: API key starts with `mik_` - **Location types**: Use `location-profile` and `location-category` - **Access pattern**: `mapData.getByType('location-profile')` ### CMS/Enterprise Data Source - **Credentials**: clientId/clientSecret, or API key that does NOT start with `mik_` - **Location types**: Use `enterprise-location` and `enterprise-category` - **Access pattern**: `mapData.getByType('enterprise-location')` ### Zip File / Bundle (hydrateMapData) **AI INSTRUCTION: When the user is loading from a zip file, ASK them before generating code:** > "I see you're loading from a zip file. Do you know if this map data is from: > 1. **Maker** (use `location-profile`) > 2. **CMS/Enterprise** (use `enterprise-location`) > 3. **Unknown / Want universal code** (use `isEnterpriseMode` to handle both) > > If you're unsure, option 3 will work with any zip file." **Based on user's answer:** - **Maker** → Generate single-path code using `location-profile`, `location-category` - **Enterprise** → Generate single-path code using `enterprise-location`, `enterprise-category`, `enterprise-venue` - **Unknown/Universal** → Generate dual-path code using `mapData.isEnterpriseMode` to detect at runtime **Important**: Using the wrong data types will result in empty arrays. ## CRITICAL: Import Paths **NEVER import map data types from `@mappedin/react-sdk`.** The React SDK only exports: - React components: `MapView`, `Marker`, `Label`, `Path`, `Shape`, `Model`, `Navigation`, `AnimatedMarker` - Hooks: `useMap`, `useMapData`, `useMapViewEvent`, `useMapDataEvent` - Component prop types: `MapViewProps`, `MarkerProps`, `LabelProps`, etc. **ALL map data types MUST be imported from `@mappedin/mappedin-js`:** ```typescript // CORRECT: import { MapView, useMapData, Marker } from '@mappedin/react-sdk'; import { Space, Floor, MapData, LocationProfile, EnterpriseLocation, Coordinate, hydrateMapData } from '@mappedin/mappedin-js'; // WRONG - these types don't exist in react-sdk: import { Space, LocationProfile } from '@mappedin/react-sdk'; // ERROR! ``` ## Common Mistakes **DO NOT import CSS** - Styles are automatically injected by the `` component by default: ```typescript // WRONG - not needed, styles are auto-injected: import '@mappedin/mappedin-js/lib/index.css'; // CORRECT - just use MapView, no CSS import needed: ``` Only import CSS manually if you explicitly set `injectStyles: false` in MapView options. **DO NOT use `mapData.spaces`** - There is no `spaces` property. Use `getByType()` instead: ```typescript // WRONG - property doesn't exist: const spaces = mapData.spaces; // CORRECT - use getByType: const spaces = mapData.getByType('space'); const floors = mapData.getByType('floor'); ``` ## Enterprise/CMS API - [EnterpriseCategory](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.EnterpriseCategory.html) (class): An EnterpriseCategory groups one or more EnterpriseLocation. - [EnterpriseLocation](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.EnterpriseLocation.html) (class): An EnterpriseLocation contains metadata about a location, such as its name, description, logo, phone number, social media links, hours of operation and more. - [EnterpriseVenue](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.EnterpriseVenue.html) (class): The EnterpriseVenue class holds metadata about the map, which includes the map name, supported languages, default language, top locations and more. ## Maker API - [LocationCategory](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.LocationCategory.html) (class): A LocationCategory groups one or more LocationProfile. - [LocationProfile](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.LocationProfile.html) (class): A LocationProfile contains metadata about a location, such as its name, description, logo, phone number, social media links, hours of operation and more. ## Core - [enableTestMode](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.enableTestMode.html) (function) - [getMapData](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.getMapData.html) (variable): Asynchronously retrieves map data (MapData) based on user-provided options. - [getVersion](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.getVersion.html) (variable): Returns the package version of the SDK. - [hydrateMapData](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.hydrateMapData.html) (variable): Load a MapData instance from a backup bundle (zip file or parsed MVF). - [MapData](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.MapData.html) (interface): MapData in Mappedin JS MapData is the core data container for all map information, providing access to spaces, floors, points of interest, and navigation capabilities. - [MapView](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.MapView.html) (class): MapView in Mappedin JS MapView is the main rendering and interaction class for Mappedin maps. - [MapView](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.MapView.html) (variable): MapView component. - [PubSub](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.PubSub.html) (interface): Generic PubSub class implementing the Publish-Subscribe pattern for event handling. - [setLoggerLevel](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.setLoggerLevel.html) (function) - [show3dMap](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.show3dMap.html) (variable) ## Camera - [BEARING_TYPE](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.BEARING_TYPE.html) (enum) - [Camera](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Camera.html) (interface): Camera in Mappedin JS The Camera class controls the map's viewpoint, including position, pitch, bearing, and zoom. - [CameraBounds](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.CameraBounds.html) (type): The pan bounds of the camera. - [CameraTransform](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.CameraTransform.html) (interface): Class representing camera transformation data. - [InsetPadding](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.InsetPadding.html) (type) - [InsetPaddingOption](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.InsetPaddingOption.html) (interface): An option for setting the inset padding of the camera. - [TBearingType](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TBearingType.html) (type) - [TCameraAnimationOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCameraAnimationOptions.html) (type): Options for Camera animations on the map. - [TCameraInteractionsSetOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCameraInteractionsSetOptions.html) (type): Options to control which camera interactions are enabled in the MapView. - [TCameraTarget](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCameraTarget.html) (type): Defines the target for camera operations. - [TFocusOnOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFocusOnOptions.html) (type): Options for focusing the Camera on a target. - [TFocusTarget](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFocusTarget.html) (type): A map element that can be focused on by the camera. ## Labels - [Label](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Label.html) (interface): Class representing a label on the MapView. - [Label](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.Label.html) (variable): Label component. - [LabelAppearance](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.LabelAppearance.html) (type): Options to control how a label is rendered. - [LabelProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.LabelProps.html) (interface) - [Labels](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Labels.html) (interface): Labels in Mappedin JS Labels are text elements anchored to map objects that automatically rotate, show/hide based on priority and zoom level, and manage collisions with other labels. - [LabelTextPlacement](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.LabelTextPlacement.html) (type) - [TAddLabelOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddLabelOptions.html) (type): Options for creating a new Label with Labels. - [TCollisionRankingTier](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCollisionRankingTier.html) (type): Defines the priority levels for collider collision handling, allowing customization of collider visibility in congested areas. - [TLabelState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TLabelState.html) (type) - [TLabelUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TLabelUpdateState.html) (type) ## Markers - [Marker](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Marker.html) (interface): Mappedin JS allows adding and removing Markers on a map using the Markers class. - [Marker](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.Marker.html) (variable): Marker component. - [MarkerProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.MarkerProps.html) (interface) - [Markers](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Markers.html) (interface): Markers in Mappedin JS Markers are interactive HTML elements anchored to a Door, Space, Coordinate, or Node on the map. - [TAddMarkerOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddMarkerOptions.html) (type): Options for controlling the behavior of a Marker. - [TCreateMarker](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCreateMarker.html) (type): Controls marker creation for navigation points. - [TMarkerPlacement](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMarkerPlacement.html) (type): Defines the placement position for a Marker, offering a selection of intuitive string options to pinpoint how the marker should be aligned. - [TMarkerState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMarkerState.html) (type) - [TMarkerUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMarkerUpdateState.html) (type) ## Paths & Navigation - [CONNECTION_TYPE](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.CONNECTION_TYPE.html) (enum) - [Directions](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Directions.html) (class): Represents a set of directions between two points. - [Navigation](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Navigation.html) (interface): When a user needs to get from point A to point B, drawing a path on the map helps them to navigate to their destination. - [Navigation](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.Navigation.html) (function) - [NavigationProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.NavigationProps.html) (interface) - [NavigationState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.NavigationState.html) (type) - [Path](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Path.html) (interface): Class representing a path on the MapView. - [Path](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.Path.html) (variable): Path component. - [PathProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.PathProps.html) (interface) - [Paths](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Paths.html) (interface): Paths in Mappedin JS Paths allow you to draw custom routes on the map, from simple straight lines between coordinates to complex navigation paths that avoid obstacles. - [PathSegment](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.PathSegment.html) (interface): A segment of a complete path. - [TAddPathOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddPathOptions.html) (type): Options for controlling the behavior of a Path. - [TConnectionPathOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TConnectionPathOptions.html) (type): Options specific to connection paths (vertical paths between floors). - [TConnectionType](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TConnectionType.html) (type) - [TDirectionInstruction](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TDirectionInstruction.html) (type): Represents a single instruction in a set of directions between two points. - [TDirectionInstructionAction](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TDirectionInstructionAction.html) (type): Represents an action within a direction instruction. - [TDirectionZone](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TDirectionZone.html) (type): Defines the special zone for navigation operations. - [TGetDirectionsOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGetDirectionsOptions.html) (type): Options for controlling the behavior of the Directions. - [TNavigationOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TNavigationOptions.html) (type): Options for navigation. - [TNavigationPathOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TNavigationPathOptions.html) (type): Path options extended with connection-specific overrides for Navigation. - [TNavigationTarget](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TNavigationTarget.html) (type): Defines the target for navigation operations. - [TPathSectionHighlightOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TPathSectionHighlightOptions.html) (type): Configuration options for highlighting a specific section of a path on the map. - [TPathState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TPathState.html) (type) - [TPathUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TPathUpdateState.html) (type) ## Models & 3D Objects - [AddText3DOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.AddText3DOptions.html) (type): Options for labeling a geometry with 3D text. - [disableText3DWorker](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.disableText3DWorker.html) (function) - [Image3D](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Image3D.html) (interface): 3D images in Mappedin JS Images can enhance indoor maps by adding custom branding, highlighting important features, or providing additional visual information. - [Image3DView](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Image3DView.html) (interface): Class representing an Image on the MapView. - [InitializeModelState](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.InitializeModelState.html) (interface): initialize model state Note: EXPERIMENTAL_clippingEnabled and visibleThroughGeometry are now part of ModelStyle - [InitializeText3DState](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.InitializeText3DState.html) (interface) - [Model](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Model.html) (interface): Class representing a 3D model on the MapView. - [Model](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.Model.html) (variable): Model component. - [ModelProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.ModelProps.html) (interface) - [Models](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Models.html) (interface): 3D Models in Mappedin JS 3D models can be used to represent landmarks, assets, or furniture, providing a rich and interactive indoor map experience. - [preloadFont](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.preloadFont.html) (function) - [Shape](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Shape.html) (interface): Class representing GeoJSON shape on the MapView. - [Shape](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.Shape.html) (variable): Shape component. - [ShapeProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.ShapeProps.html) (interface) - [Shapes](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Shapes.html) (interface): Shapes in Mappedin JS The Shapes class allows you to draw custom 3D geometry on the map using GeoJSON. - [TAddImageOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddImageOptions.html) (type): Options for controlling the behavior of an Image3DView. - [TAddModel](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddModel.html) (type): The target for the add model operation. - [TAddModelOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddModelOptions.html) (type): Options for controlling the behavior of a Model. - [TAddText3DAnchorableOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAddText3DAnchorableOptions.html) (type): Options for adding 3D text at an anchorable target (e. - [TAddText3DOptions](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.TAddText3DOptions.html) (interface) - [Text3D](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Text3D.html) (interface): Text3D in Mappedin JS Text3D creates three-dimensional text labels that are rendered directly in the 3D scene. - [Text3DView](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Text3DView.html) (interface): Class representing an Text3D on the MapView. - [TImageState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TImageState.html) (type) - [TImageUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TImageUpdateState.html) (type) - [TModelState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TModelState.html) (type): Represents the state of a model. - [TModelUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TModelUpdateState.html) (type) - [TShapeState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TShapeState.html) (type): Represents the state of a shape. - [TShapeUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TShapeUpdateState.html) (type) - [TText3DState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TText3DState.html) (type) - [TText3DUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TText3DUpdateState.html) (type) ## Map Data Objects - [Annotation](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Annotation.html) (class): A class representing annotation data within the map. - [Area](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Area.html) (class): An Area represents some grouping of multiple pieces of geometry, not necessarily bounded by walls or any other physical feature of the map. - [Connection](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Connection.html) (class): A class representing connection data within the map. - [Coordinate](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Coordinate.html) (class): Class representing a pseudo-mercator coordinate. - [DetailedMapData](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.DetailedMapData.html) (class) - [Door](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Door.html) (class): A class representing door data within the map. - [DOORS](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.DOORS.html) (enum) - [Facade](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Facade.html) (class): A Facade is a collection of spaces that make up the exterior representation of a Floor Stack (FloorStack). - [Floor](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Floor.html) (class): A class representing floor data within the map. - [FloorStack](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.FloorStack.html) (class): A class representing floor stack data within the map. - [Hyperlink](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Hyperlink.html) (class): A class representing hyperlink link data within the map. - [ImageMetaData](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.ImageMetaData.html) (class): A class representing image link data within the map. - [MapObject](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.MapObject.html) (class): A class representing generic map object data within the map. - [Node](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Node.html) (class): A class representing Path node data within the map. - [PointOfInterest](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.PointOfInterest.html) (class): A class representing point of interest data within the map. - [SiblingGroup](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.SiblingGroup.html) (type) - [Space](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.Space.html) (class): A Space represents an area enclosed by walls, such as a hall or room. - [TCoordinateParams](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCoordinateParams.html) (type): Parameters for creating a Coordinate. - [TSpaceType](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TSpaceType.html) (type): Represents the various types of spaces that can be defined within a map. - [WALLS](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.WALLS.html) (enum) ## Search & Query - [MatchInfo](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MatchInfo.html) (type): Match information for a search result. - [Places](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Places.html) (type): Places are the main objects that can be searched for. - [Query](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Query.html) (interface): Query allows users to query for nodes, locations, categories, and other points of interest within the venue. - [Search](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Search.html) (interface): Search allows users to search for locations, categories, and other points of interest within the venue. - [SearchOptions](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.SearchOptions.html) (interface) - [SearchResult](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.SearchResult.html) (type): Search results - [SearchResultEnterpriseCategory](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.SearchResultEnterpriseCategory.html) (interface) - [SearchResultEnterpriseLocations](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.SearchResultEnterpriseLocations.html) (interface) - [SearchResultItem](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.SearchResultItem.html) (type) - [SearchResultPlaces](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.SearchResultPlaces.html) (interface) - [Suggestion](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Suggestion.html) (type): The type of auto-suggestions - [TFindNearestOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFindNearestOptions.html) (type): Options for the nearest query - [TFindNearestResult](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFindNearestResult.html) (type): Result of a nearest query - [TQueriables](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TQueriables.html) (type): Types that can be queried for in the nearest search - [TSearchOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TSearchOptions.html) (type): Options for configuring search functionality. ## Events - [CaptureEventsPayloadMap](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.CaptureEventsPayloadMap.html) (type): Maps reserved analytics event names to their payload structures. - [TClickPayload](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TClickPayload.html) (type): The payload for a user click event on the map. - [TEventPayload](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TEventPayload.html) (type) - [TEvents](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TEvents.html) (type): Defines the structure and types of events emitted in the context of the map. - [TFloorChangePayload](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFloorChangePayload.html) (type): Describes the payload delivered with floor change events. - [TFloorChangeReason](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFloorChangeReason.html) (type) - [THoverPayload](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.THoverPayload.html) (type): Represents the payload for a hover event on the map. ## Styling & Rendering - [ANIMATION_TWEENS](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.ANIMATION_TWEENS.html) (variable) - [ColorString](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.ColorString.html) (type): A color string. - [Environment](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Environment.html) (type): Represents the environment state configuration. - [EnvMapOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.EnvMapOptions.html) (type) - [FootprintConfig](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.FootprintConfig.html) (type) - [InterpolateOn](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.InterpolateOn.html) (type): Different properties that can be interpolated on, and what input values are expected. - [Interpolation](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Interpolation.html) (type): Define interpolation behavior for a value. - [LineStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.LineStyle.html) (type) - [MAPPEDIN_COLORS](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_mappedin-js.MAPPEDIN_COLORS.html) (variable) - [MapViewState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapViewState.html) (type) - [Outdoor](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Outdoor.html) (interface): The outdoor map shown around the Mappedin indoor map can be manipulated to show or hide additional information. - [OutlinesOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.OutlinesOptions.html) (type): Outline rendering configuration options - [PaintStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.PaintStyle.html) (type) - [RendererCoreOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.RendererCoreOptions.html) (type) - [Shading](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Shading.html) (type) - [Style](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Style.html) (interface) - [TAnimationOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAnimationOptions.html) (type): Options for controlling animations on the map. - [TAntialiasingOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAntialiasingOptions.html) (type): Represents all the available antialiasing options. - [TShow3DMapOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TShow3DMapOptions.html) (type): Options for showing a 3D map. - [TWallsState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TWallsState.html) (type) - [TWallsUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TWallsUpdateState.html) (type) - [VisibilityState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.VisibilityState.html) (type) ## State Management - [getMultiFloorState](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.getMultiFloorState.html) (function) - [GlobalState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GlobalState.html) (type) - [LocationState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.LocationState.html) (type): The state of a location. - [MapElementsWithState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapElementsWithState.html) (type): All map elements which have state. - [MapElementToGetRenderedState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapElementToGetRenderedState.html) (type) - [MapElementToGetState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapElementToGetState.html) (type): Centralized mapping of element types to their get state types. - [MapElementToUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapElementToUpdateState.html) (type): Centralized mapping of element types to their update state types. - [TAnimateStateResult](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TAnimateStateResult.html) (type) - [TDoorsState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TDoorsState.html) (type) - [TDoorsUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TDoorsUpdateState.html) (type) - [TFacadeState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFacadeState.html) (type) - [TFacadeUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFacadeUpdateState.html) (type) - [TFloorState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFloorState.html) (type) - [TFloorUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFloorUpdateState.html) (type) - [TGeometryState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGeometryState.html) (type): Defines the state for geometry elements like Space when updated. - [TGeometryUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGeometryUpdateState.html) (type) - [TGetState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGetState.html) (type): The type for getting the state of map elements. - [TMultiFloorViewOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMultiFloorViewOptions.html) (type): Options for controlling multi-floor view. - [TRendererState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TRendererState.html) (type) - [TUpdateState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TUpdateState.html) (type): The type for updating the state of map elements (colors, texts, etc. - [WithState](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.WithState.html) (type): Filter type that extracts only elements which have state. ## Map Data Access - [Analytics](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Analytics.html) (interface) - [IAnchorable](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.IAnchorable.html) (interface): A class that implements IAnchorable can have 2D elements like Labels and Markers anchored to it. - [IFocusable](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.IFocusable.html) (interface): A class that implements IFocusable can be focused on by the camera. - [IGeoJSONData](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.IGeoJSONData.html) (interface): A class that implements IGeoJSONData has a underlying GeoJSON datathat can be accessed. - [INavigatable](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.INavigatable.html) (interface): A class that implements INavigatable can be navigated to via directions. - [ISystemPlugin](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.ISystemPlugin.html) (interface) - [MapDataElements](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapDataElements.html) (type): Elements created by the MapData. - [MapFeatureOfType](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapFeatureOfType.html) (type): Returns the class type for a given type string. - [MapViewElements](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.MapViewElements.html) (type): Elements created by the MapView. - [TAnalyticsUpdateState](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.TAnalyticsUpdateState.html) (interface): Options for updating the current state of analytics. - [TGetMapDataOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGetMapDataOptions.html) (type) - [TGetMapDataSharedOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TGetMapDataSharedOptions.html) (type) - [TGetMapDataWithAccessTokenOptions](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.TGetMapDataWithAccessTokenOptions.html) (interface) - [TGetMapDataWithCredentialsOptions](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.TGetMapDataWithCredentialsOptions.html) (interface): Fetch map data using a key/secret pair and additional options. - [THydrateMapDataBundle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.THydrateMapDataBundle.html) (type) - [TMapDataEvents](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMapDataEvents.html) (type) - [TMapDataObjectTypes](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMapDataObjectTypes.html) (type): Associates MapData type strings with their corresponding classes. - [TMapFeatureTypes](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMapFeatureTypes.html) (type): Associates MapData and MapView type strings with their corresponding classes. - [TMapViewObjectTypes](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMapViewObjectTypes.html) (type): Associates MapView type strings with their corresponding classes. ## GeoJSON Types - [BBox](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.BBox.html) (type): Bounding box https://tools. - [Feature](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Feature.html) (interface): A feature object which contains a geometry and associated properties. - [FeatureCollection](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.FeatureCollection.html) (interface): A collection of feature objects. - [GeoJSON](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GeoJSON.html) (type): Union of GeoJSON objects. - [GeoJsonGeometryTypes](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GeoJsonGeometryTypes.html) (type): The valid values for the "type" property of GeoJSON geometry objects. - [GeoJsonObject](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.GeoJsonObject.html) (interface): The base GeoJSON object. - [GeoJsonProperties](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GeoJsonProperties.html) (type) - [GeoJsonTypes](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GeoJsonTypes.html) (type): The value values for the "type" property of GeoJSON Objects. - [Geometry](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Geometry.html) (type): Geometry object. - [GeometryCollection](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.GeometryCollection.html) (interface): Geometry Collection https://tools. - [GeometryObject](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.GeometryObject.html) (type) - [LineString](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.LineString.html) (interface): LineString geometry object. - [MultiLineString](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.MultiLineString.html) (interface): MultiLineString geometry object. - [MultiPoint](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.MultiPoint.html) (interface): MultiPoint geometry object. - [MultiPolygon](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.MultiPolygon.html) (interface): MultiPolygon geometry object. - [Point](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Point.html) (interface): Point geometry object. - [Polygon](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Polygon.html) (interface): Polygon geometry object. - [Position](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.Position.html) (type): A Position is an array of coordinates. - [TMVF](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVF.html) (type) - [TMVFLineStringStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVFLineStringStyle.html) (type) - [TMVFPointStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVFPointStyle.html) (type) - [TMVFPolygonStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVFPolygonStyle.html) (type) - [TMVFStyle](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVFStyle.html) (type) - [TMVFStyleCollection](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TMVFStyleCollection.html) (type): A map of layer styles, where keys represent the group IDs of each style. ## React Components & Hooks - [AnimatedMarker](https://docs.mappedin.com/react/v6/latest/variables/_mappedin_react-sdk.AnimatedMarker.html) (variable): AnimatedMarker component. - [MapDataProvider](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.MapDataProvider.html) (function) - [MapDataProviderProps](https://docs.mappedin.com/react/v6/latest/types/_mappedin_react-sdk.MapDataProviderProps.html) (type) - [MapViewProps](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_react-sdk.MapViewProps.html) (interface) - [useMap](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.useMap.html) (function) - [useMapData](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.useMapData.html) (function) - [useMapDataEvent](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.useMapDataEvent.html) (function) - [useMapViewEvent](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_react-sdk.useMapViewEvent.html) (function) ## API Reference - [__INTERNAL__MapLibreOverlay](https://docs.mappedin.com/react/v6/latest/classes/_mappedin_mappedin-js.__INTERNAL__MapLibreOverlay.html) (class): Generic PubSub class implementing the Publish-Subscribe pattern for event handling. - [Debug](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.Debug.html) (interface) - [findPreferredLanguageInVenue](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.findPreferredLanguageInVenue.html) (function) - [OpeningHours](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.OpeningHours.html) (interface): Represents the opening hours of a location. - [setWorkersUrl](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.setWorkersUrl.html) (function) - [TWatermarkOptions](https://docs.mappedin.com/react/v6/latest/interfaces/_mappedin_mappedin-js.TWatermarkOptions.html) (interface): Options for the watermark. - [unzipAndParseMVFv2](https://docs.mappedin.com/react/v6/latest/functions/_mappedin_mappedin-js.unzipAndParseMVFv2.html) (function) ## Types & Configuration - [ACTION_TYPE](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.ACTION_TYPE.html) (enum) - [AutoElements](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.AutoElements.html) (type) - [E_SDK_LOG_LEVEL](https://docs.mappedin.com/react/v6/latest/enums/_mappedin_mappedin-js.E_SDK_LOG_LEVEL.html) (enum) - [LocationSocial](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.LocationSocial.html) (type) - [OperationHours](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.OperationHours.html) (type): We (almost) follow this schema (http://schema. - [TActionType](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TActionType.html) (type) - [TCancellablePromise](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TCancellablePromise.html) (type) - [TEasingFunction](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TEasingFunction.html) (type): Types of easing for animations. - [TFindPreferredLanguageInVenueOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TFindPreferredLanguageInVenueOptions.html) (type) - [TQueryAtResult](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TQueryAtResult.html) (type): Types that can be returned from Query. - [TSetFloorOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TSetFloorOptions.html) (type) - [TTakeScreenshotOptions](https://docs.mappedin.com/react/v6/latest/types/_mappedin_mappedin-js.TTakeScreenshotOptions.html) (type): Options for taking a screenshot. ## Quick Reference Examples ### Correct Import Pattern ```typescript // React components and hooks from react-sdk import { MapView, useMapData, Marker, Label } from '@mappedin/react-sdk'; // ALL map data types from mappedin-js import { Space, Floor, MapData, Coordinate, LocationProfile, // Maker data LocationCategory, // Maker data EnterpriseLocation, // Enterprise data EnterpriseCategory, // Enterprise data hydrateMapData, // For loading from zip files } from '@mappedin/mappedin-js'; ``` ### Zip File / Unknown Data Source (RECOMMENDED for offline bundles) ```typescript import { MapView } from '@mappedin/react-sdk'; import { hydrateMapData, MapData } from '@mappedin/mappedin-js'; import { useState, useEffect } from 'react'; function App({ bundleUrl }: { bundleUrl: string }) { const [mapData, setMapData] = useState(null); useEffect(() => { async function loadMap() { const response = await fetch(bundleUrl); const buffer = new Uint8Array(await response.arrayBuffer()); const data = await hydrateMapData({ type: 'binary', main: buffer }); setMapData(data); } loadMap(); }, [bundleUrl]); if (!mapData) return
Loading...
; // IMPORTANT: Check isEnterpriseMode for data source detection const locations = mapData.isEnterpriseMode ? mapData.getByType('enterprise-location') : mapData.getByType('location-profile'); const categories = mapData.isEnterpriseMode ? mapData.getByType('enterprise-category') : mapData.getByType('location-category'); return ; } ``` ### Maker Example (keys starting with mik_) ```typescript import { MapView, useMapData, Marker } from '@mappedin/react-sdk'; import { Space, LocationProfile } from '@mappedin/mappedin-js'; function App() { const { mapData } = useMapData({ key: 'mik_xxx', secret: 'mis_xxx', mapId: '65c0ff7430b94e3fabd5bb8c' }); // Use location-profile for Maker data const locations = mapData?.getByType('location-profile') ?? []; const categories = mapData?.getByType('location-category') ?? []; return ; } ``` ### CMS/Enterprise Example (clientId/clientSecret) ```typescript import { MapView, useMapData, Marker } from '@mappedin/react-sdk'; import { Space, EnterpriseLocation } from '@mappedin/mappedin-js'; function App() { const { mapData } = useMapData({ key: 'your-client-id', secret: 'your-client-secret', mapId: 'mappedin-demo-mall' }); // Use enterprise-location for CMS data const locations = mapData?.getByType('enterprise-location') ?? []; const categories = mapData?.getByType('enterprise-category') ?? []; const venue = mapData?.getByType('enterprise-venue'); return ; } ```