From 88a69eab9da9243e26758a4200023a46b6fb1900 Mon Sep 17 00:00:00 2001 From: Mateusz Banaszak Date: Mon, 13 Jan 2025 10:22:10 +0100 Subject: [PATCH 1/3] add: logic to respect miTransitionLevel prop --- .../src/components/MIMap/MapboxMap/MapboxMap.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx b/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx index b0fd16ac3..6456387b9 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 '../../../../../../packages/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); From 685b492e691ea0679754735990fe45c9b8d1614b Mon Sep 17 00:00:00 2001 From: Mateusz Banaszak Date: Mon, 13 Jan 2025 10:24:39 +0100 Subject: [PATCH 2/3] add: changelog --- packages/map-template/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) 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 From 78f967ee9e4f978674fdbe8cec9f80797638e1e7 Mon Sep 17 00:00:00 2001 From: andreeaceachir Date: Mon, 13 Jan 2025 10:50:21 +0100 Subject: [PATCH 3/3] chore: Update path. --- .../src/components/MIMap/MapboxMap/MapboxMap.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx b/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx index 6456387b9..05c2f2bb6 100644 --- a/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx +++ b/packages/react-components/src/components/MIMap/MapboxMap/MapboxMap.jsx @@ -7,7 +7,7 @@ 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 '../../../../../../packages/map-template/src/atoms/miTransitionLevelState' +import miTransitionLevelState from '../../../../../map-template/src/atoms/miTransitionLevelState'; MapboxMap.propTypes = { accessToken: PropTypes.string.isRequired,