diff --git a/packages/map-template/CHANGELOG.md b/packages/map-template/CHANGELOG.md index b7b8d1795..1e299de20 100644 --- a/packages/map-template/CHANGELOG.md +++ b/packages/map-template/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.65.2] - 2025-01-13 + +## Fixed + +- An issue where miTransitionLevel is not respected for Mapbox map. + ## [1.65.1] - 2025-01-08 ## Fixed diff --git a/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx b/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx index b0fd16ac3..05c2f2bb6 100644 --- a/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx +++ b/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx @@ -6,6 +6,8 @@ import './MapboxMap.scss'; import ViewModeSwitch from './ViewModeSwitch/ViewModeSwitch'; import { useIsDesktop } from '../../../hooks/useIsDesktop'; import isNullOrUndefined from '../../../../../map-template/src/helpers/isNullOrUndefined'; +import { useRecoilValue } from 'recoil'; +import miTransitionLevelState from '../../../../../map-template/src/atoms/miTransitionLevelState'; MapboxMap.propTypes = { accessToken: PropTypes.string.isRequired, @@ -44,6 +46,7 @@ function MapboxMap({ accessToken, onInitialized, onPositionControl, center, zoom const [hasPositionControl, setHasPositionControl] = useState(false); const [hasZoomControl, setHasZoomControl] = useState(false); const isDesktop = useIsDesktop(); + const miTransitionLevel = useRecoilValue(miTransitionLevelState); /* * React on any props that are used to control the position of the map. @@ -134,6 +137,11 @@ function MapboxMap({ accessToken, onInitialized, onPositionControl, center, zoom ...mapOptions }; + // If miTransitionLevel exists and it's a number, set it in the mapViewOptions + if (miTransitionLevel && !isNaN(parseInt(miTransitionLevel))) { + mapViewOptions.mapsIndoorsTransitionLevel = parseInt(miTransitionLevel); + } + const mapView = new window.mapsindoors.mapView.MapboxV3View(mapViewOptions); setMapViewInstance(mapView);