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 asQueryAtResult
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 -
DynamicFocusmethods for complete control over floor visibility and view state management:preloadFloors()- Preloads initial floors for improved rendering performancesetIndoor()andsetOutdoor()- Forces indoor or outdoor view state regardless of zoom levelsetDefaultFloorForStack(floorStack, floor)andresetDefaultFloorForStack(floorStack)- Manages default floors forFloorStacksgetDefaultFloorForStack(floorStack)andgetCurrentFloorForStack(floorStack)- Gets default and current floorssetCurrentFloorForStack(floorStack, floor)- Sets the current visible floor for aFloorStackexclude(floorStack)/exclude(floorStacks)andinclude(floorStack)/include(floorStacks)- Excludes or includesFloorStacks from Dynamic Focus visibility changesdestroy()- Destroys theDynamicFocusinstance 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.collisionsEnabledproperty to control whether floor images participate in collision detection - Added - Footprint properties to
FloorStateandFloorUpdateState:basementMaskEnabled,ceilingThickness,ceilingVisible, andoutline - Added -
ModelUpdateState.clippingPlaneZOffsetproperty to control model clipping plane. UseDouble.POSITIVE_INFINITYto 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.atmethod to find all geometry objects (Spaces,MapObjects,Areas,Floors) at a given coordinate, with typed results returned asQueryAtResult
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.collisionsEnabledproperty to control whether floor images participate in collision detection - Added -
ModelUpdateState.clippingPlaneZOffsetproperty to control model clipping plane. Use.infinityto disable clipping
// Disable clipping for a modellet noClipState = ModelUpdateState(clippingPlaneZOffset: .infinity)// Set explicit clipping plane offsetlet clipState = ModelUpdateState(clippingPlaneZOffset: 5.0)
- Added -
DynamicFocusmethods for full API parity:preloadFloors()- Preloads initial floors for improved rendering performancesetIndoor()andsetOutdoor()- Forces indoor or outdoor view state regardless of zoom levelsetDefaultFloorForStack(floorStack:floor:)andresetDefaultFloorForStack(floorStack:)- Manages default floors forFloorStacksgetDefaultFloorForStack(floorStack:)andgetCurrentFloorForStack(floorStack:)- Gets default and current floorssetCurrentFloorForStack(floorStack:floor:)- Sets the current visible floor for aFloorStackexclude(floorStack:)/exclude(floorStacks:)andinclude(floorStack:)/include(floorStacks:)- Excludes or includesFloorStacks from Dynamic Focus visibility changesdestroy()- Destroys theDynamicFocusinstance 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.isEnterpriseModeproperty 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)") }}