Mappedin SDKs and Developer Tools

website·Indexed 36 days ago

https://developer.mappedin.com

Developer documentation for Mappedin's indoor mapping ecosystem, featuring SDKs for JS, React, React Native, iOS, and Android (v6.0). Includes guides on 3D model implementation, Mappedin Venue Format (MVF v1 and v3), Blue Dot positioning, and specialized tools like the 3D Model Mapper and MapLibre Overlay for interactive 3D indoor maps and wayfinding.

Tokens
175.7K
Snippets
768
Records
1.2K
Agent score
65%

What's inside Mappedin

  1. Overview of Mappedin Venue Format (MVF) v3

    Mappedin Venue Format (MVF) v3 is a GeoJSON-based format containing geometry data associated with indoor maps. It is designed for 2D and 3D rendering, providing flexibility to build indoor mapping experiences by adhering to GeoJSON specifications with additional styling extensions.
  2. Overview of Mappedin React Native SDK

    v6
    The Mappedin React Native SDK provides components and hooks for building indoor mapping mobile applications on iOS, Android, and Expo Web via a WebView bridge. It is built on @mappedin/mappedin-js and includes full TypeScript support.
  3. Overview of Mappedin Venue Format (MVF) v1

    Mappedin Venue Format (MVF) is a GeoJSON-based data format used to represent venue geometry and location data programmatically. It allows developers to export highly accurate indoor map data from the Mappedin CMS to build 2D mapping experiences, 3D renderings, or wayfinding capabilities (including nodes and paths).
  4. Understand the MVF v3 Core Structure

    An MVF v3 package, when parsed with core extensions, produces an object containing geometry, floors, and a manifest. The geometry extension organizes data by floorId (matching IDs in floors.geojson), allowing for partial parsing and faster load times.

    • Manifest (manifest.geojson): Contains the file structure of the MVF and global metadata (e.g., venue name, default map, language).
    • Floors (floors.geojson): A FeatureCollection of all floors/levels, including names and elevations.
    • Geometry: A folder containing one GeoJSON file per floorId. These files contain all geometry (lines, polygons, points) for that floor. Geometry features may include an externalId (e.g., a room number).
    {
    	geometry: {
    		abcde1234: { // GeometryFeatureCollection },
    		abcde1235: { // GeometryFeatureCollection }
    	},
    	floors: { // FloorsFeatureCollection },
    	manifest: { // ManifestFeatureCollection }
    }
  5. Handle map click events

    Listen for click events on the map using mapView.on with Events.Click. The callback provides a ClickPayload containing information about the clicked element, such as labels, spaces, paths, floors, and coordinates.
    mapView.on(Events.Click) { clickPayload ->
        clickPayload ?: return@on
    
        val labels = clickPayload.labels
        if (!labels.isNullOrEmpty()) {
            Log.i("Click", "Label Clicked: ${labels.first().text}")
        }
    
        val spaces = clickPayload.spaces
        if (!spaces.isNullOrEmpty()) {
            Log.i("Click", "Space Clicked: ${spaces.first().name}")
        }
    
        Log.i("Click", "Coordinate: ${clickPayload.coordinate.latitude}, ${clickPayload.coordinate.longitude}")
    }
  6. Validate IMDF archives with IMDF Validator

    The IMDF Validator validates Indoor Mapping Data Format (IMDF) zip archives against the official IMDF specification and a set of business rules. Users drag and drop the zip file to parse it and review issues grouped by severity.
  7. Use deck.gl for high-performance indoor data visualization

    deck.gl is a WebGL-based framework used alongside Mappedin JS to create high-performance visual exploratory data analysis of large datasets on indoor maps, such as heatmaps.
  8. Retrieve and display map annotations

    Annotations provide visual or textual information about specific locations. You can retrieve all annotations from the map data using mapView.mapData.getByType with the MapDataType.ANNOTATION type.
    mapView.mapData.getByType<Annotation>(com.mappedin.models.MapDataType.ANNOTATION) { r ->
      r.onSuccess { annotations ->
        // Log the name of each annotation
        annotations.forEach { annotation ->
          Log.d("Annotation", annotation.name)
        }
      }
    }
  9. Handle map click and long-press events in Mappedin iOS SDK

    Use the mapView.on() method with Events.click and Events.longPress to listen for user interactions. Both events provide a ClickPayload containing information about the clicked element, such as floors, labels, spaces, paths, and the specific geographic coordinates.
    // Set up click listener
    mapView.on(Events.click) { [weak self] clickPayload in
        guard let self = self, let click = clickPayload else { return }
        self.handleClick(click, longPress: false)
    }
    
    // Set up long-press listener
    mapView.on(Events.longPress) { [weak self] clickPayload in
        guard let self = self, let click = clickPayload else { return }
        self.handleClick(click, longPress: true)
    }
    
    private func handleClick(_ clickPayload: ClickPayload, longPress: Bool = false) {
        // Extract data from ClickPayload
        let title = clickPayload.floors?.first?.name ?? "Map"
        let labelText = clickPayload.labels?.first?.text
        let spaceName = clickPayload.spaces?.first?.name
        let coordinate = clickPayload.coordinate
        
        print("Clicked at: \(coordinate.latitude), \(coordinate.longitude)")
    }
  10. Retrieve Enterprise Venue metadata

    The Enterprise Venue class holds global metadata about the map, including the map name, supported languages, default language, and top locations. This requires an Enterprise Tier subscription.
    mapData.getByType('enterprise-venue');
  11. Handle map click and long-press events in React Native

    Use the useMapViewEvent hook to listen for click and long-press events. The event payload (Mappedin.TClickPayload) provides information about the clicked element, such as floors, labels, spaces, paths, and geographic coordinates.
    const handleEvent = (payload: Mappedin.TClickPayload, longPress: boolean) => {
      const title = payload.floors?.[0]?.name ?? (longPress ? "Map Long Press" : "Map Click");
      console.log(title);
      if (longPress) {
        console.log("Long press");
      }
      if (payload.labels && payload.labels.length > 0) {
        console.log("Label Clicked: " + payload.labels[0].text);
      }
      if (payload.spaces && payload.spaces.length > 0) {
        console.log("Space clicked: " + payload.spaces[0].name);
      }
      if (payload.paths && payload.paths.length > 0) {
        console.log("You clicked a path.");
      }
      console.log("Latitude: " + payload.coordinate.latitude);
      console.log("Longitude: " + payload.coordinate.longitude);
    };
    
    useMapViewEvent("click", (payload: Mappedin.TClickPayload) => {
      handleEvent(payload, false);
    });
    
    useMapViewEvent("long-press", (payload: Mappedin.TClickPayload) => {
      handleEvent(payload, true);
    });
  12. Manage indoor and outdoor map transitions with DynamicFocus

    v6
    The DynamicFocus class acts as a MapView scene manager. It is designed to maintain the visibility of the outdoors while automatically fading building interiors in and out as the camera pans, creating a seamless transition between different map views.