@@ -73,7 +73,9 @@ import {
7373 THROTTLE_NOTIFICATION_TIME ,
7474 DEFAULT_PICKING_RADIUS ,
7575 NO_MAP_ID ,
76- EMPTY_MAPBOX_STYLE
76+ EMPTY_MAPBOX_STYLE ,
77+ MAPBOX_MAX_PITCH ,
78+ MAP_LIB_OPTIONS
7779} from '@kepler.gl/constants' ;
7880
7981import { DROPPABLE_MAP_CONTAINER_TYPE } from './common/dnd-layer-items' ;
@@ -1011,7 +1013,9 @@ export default function MapContainerFactory(
10111013 isInteractive
10121014 ? {
10131015 doubleClickZoom : ! isEditorDrawingMode ,
1014- dragRotate : this . props . mapState . dragRotate
1016+ dragRotate : this . props . mapState . dragRotate ,
1017+ maxPitch :
1018+ this . props . mapState . maxPitch ?? getApplicationConfig ( ) . maxPitch
10151019 }
10161020 : false
10171021 }
@@ -1177,8 +1181,13 @@ export default function MapContainerFactory(
11771181 getApplicationConfig ( ) . baseMapLibraryConfig ?. [ baseMapLibraryName ] ;
11781182
11791183 const internalViewState = this . context ?. getInternalViewState ( index ) ;
1184+ const configMaxPitch = mapState . maxPitch ?? getApplicationConfig ( ) . maxPitch ;
1185+ const effectiveMaxPitch = baseMapLibraryName === MAP_LIB_OPTIONS . MAPBOX
1186+ ? Math . min ( configMaxPitch , MAPBOX_MAX_PITCH )
1187+ : configMaxPitch ;
11801188 const mapProps = {
11811189 ...internalViewState ,
1190+ maxPitch : effectiveMaxPitch ,
11821191 preserveDrawingBuffer : this . props . isExport ?? false ,
11831192 mapboxAccessToken : currentStyle ?. accessToken || mapboxApiAccessToken ,
11841193 // baseApiUrl: mapboxApiUrl,
@@ -1272,6 +1281,7 @@ export default function MapContainerFactory(
12721281 < MapComponent
12731282 key = { `top-${ baseMapLibraryName } ` }
12741283 viewState = { internalViewState }
1284+ maxPitch = { effectiveMaxPitch }
12751285 mapStyle = { mapStyle . topMapStyle }
12761286 style = { MAP_STYLE . top }
12771287 mapboxAccessToken = { mapProps . mapboxAccessToken }
0 commit comments