Mappedin SDK for Android & iOS 6.2.0-beta.1

Mappedin SDK for Android & iOS v6.2.0-beta.0 released! Features are similar, each section has code examples for Swift or Kotlin.

Android

  • Upgraded to Mappedin JS v6.14.0
  • Added - Query.at(coordinate) method to find all geometry objects (Spaces, MapObjects, Areas, Floors) at a given coordinate, with typed results returned as QueryAtResult
val coord = Coordinate(latitude = 43.861, longitude = -78.947, floorId = "floor1")mapData.query.at(coord) { result ->    result.onSuccess { atResults ->        atResults?.forEach { queryResult ->            when (queryResult) {                is QueryAtResult.SpaceResult -> Log.d("Query", "Space: ${queryResult.space.name}")                is QueryAtResult.MapObjectResult -> Log.d("Query", "MapObject: ${queryResult.mapObject.name}")                is QueryAtResult.AreaResult -> Log.d("Query", "Area: ${queryResult.area.name}")                is QueryAtResult.FloorResult -> Log.d("Query", "Floor: ${queryResult.floor.name}")            }        }    }}
  • Added - DynamicFocus methods for complete control over floor visibility and view state management:
    • preloadFloors() - Preloads initial floors for improved rendering performance
    • setIndoor() and setOutdoor() - Forces indoor or outdoor view state regardless of zoom level
    • setDefaultFloorForStack(floorStack, floor) and resetDefaultFloorForStack(floorStack) - Manages default floors for FloorStacks
    • getDefaultFloorForStack(floorStack) and getCurrentFloorForStack(floorStack) - Gets default and current floors
    • setCurrentFloorForStack(floorStack, floor) - Sets the current visible floor for a FloorStack
    • exclude(floorStack) / exclude(floorStacks) and include(floorStack) / include(floorStacks) - Excludes or includes FloorStacks from Dynamic Focus visibility changes
    • destroy() - Destroys the DynamicFocus instance and cleans up event listeners
// Force indoor viewmapView.dynamicFocus.setIndoor()// Set current floor for a floor stackmapView.dynamicFocus.setCurrentFloorForStack(building.floorStack, floor2) { }// Exclude a building from dynamic focus visibility changesmapView.dynamicFocus.exclude(parkingGarage.floorStack) { }// Clean up when donemapView.dynamicFocus.destroy()
  • Added - MapData.isEnterpriseMode() method to programmatically determine whether a map uses CMS/Enterprise or Maker data. Runtime warnings are now logged when using data types that don’t match the map’s data source
mapData.isEnterpriseMode { result ->    result.onSuccess { isEnterprise ->        if (isEnterprise) {            mapData.getByType(MapDataType.ENTERPRISE_LOCATION) { locResult ->                // Handle enterprise locations            }        } else {            mapData.getByType(MapDataType.LOCATION_PROFILE) { locResult ->                // Handle maker locations            }        }    }}
  • Added - FloorState.Images.collisionsEnabled property to control whether floor images participate in collision detection
  • Added - Footprint properties to FloorState and FloorUpdateState: basementMaskEnabled, ceilingThickness, ceilingVisible, and outline
  • Added - ModelUpdateState.clippingPlaneZOffset property to control model clipping plane. Use Double.POSITIVE_INFINITY to disable clipping
// Disable clipping for a modelval noClipState = ModelUpdateState(clippingPlaneZOffset = Double.POSITIVE_INFINITY)// Set explicit clipping plane offsetval clipState = ModelUpdateState(clippingPlaneZOffset = 5.0)

iOS

  • Upgraded to Mappedin JS v6.14.0
  • Added - Query.at method to find all geometry objects (Spaces, MapObjects, Areas, Floors) at a given coordinate, with typed results returned as QueryAtResult
mapView.mapData.query.at(coordinate: coordinate) { result in    switch result {    case .success(let results):        results?.forEach { queryResult in            switch queryResult {            case .space(let space):                mapView.updateState(space: space, state: GeometryUpdateState(color: "#FF6B35"))            case .mapObject(let mapObject):                print("MapObject at point: \(mapObject.name)")            case .area(let area):                print("Area at point: \(area.name)")            case .floor(let floor):                print("Floor at point: \(floor.name)")            default:                break            }        }    case .failure(let error):        print("Query.at failed: \(error)")    }}
  • Added - FloorState.Images.collisionsEnabled property to control whether floor images participate in collision detection
  • Added - ModelUpdateState.clippingPlaneZOffset property to control model clipping plane. Use .infinity to disable clipping
// Disable clipping for a modellet noClipState = ModelUpdateState(clippingPlaneZOffset: .infinity)// Set explicit clipping plane offsetlet clipState = ModelUpdateState(clippingPlaneZOffset: 5.0)
  • Added - DynamicFocus methods for full API parity:
    • preloadFloors() - Preloads initial floors for improved rendering performance
    • setIndoor() and setOutdoor() - Forces indoor or outdoor view state regardless of zoom level
    • setDefaultFloorForStack(floorStack:floor:) and resetDefaultFloorForStack(floorStack:) - Manages default floors for FloorStacks
    • getDefaultFloorForStack(floorStack:) and getCurrentFloorForStack(floorStack:) - Gets default and current floors
    • setCurrentFloorForStack(floorStack:floor:) - Sets the current visible floor for a FloorStack
    • exclude(floorStack:) / exclude(floorStacks:) and include(floorStack:) / include(floorStacks:) - Excludes or includes FloorStacks from Dynamic Focus visibility changes
    • destroy() - Destroys the DynamicFocus instance and cleans up event listeners
// Force indoor viewdynamicFocus.setIndoor()// Set current floor for a floor stackdynamicFocus.setCurrentFloorForStack(floorStack: building.floorStack, floor: floor2) { _ in }// Exclude a building from dynamic focus visibility changesdynamicFocus.exclude(floorStack: parkingGarage.floorStack)// Clean up when donedynamicFocus.destroy()
  • Added - MapData.isEnterpriseMode property to determine whether the loaded map uses CMS/Enterprise or Maker data. Runtime warnings are now logged when requesting data types that do not match the active data source
mapView.mapData.isEnterpriseMode { result in    switch result {    case .success(let isEnterprise):        if isEnterprise {            mapView.mapData.getByType(.enterpriseLocation) { (locResult: Result<[EnterpriseLocation], Error>) in                // Handle enterprise locations            }        } else {            mapView.mapData.getByType(.locationProfile) { (locResult: Result<[LocationProfile], Error>) in                // Handle maker locations            }        }    case .failure(let error):        print("Error: \(error)")    }}