@@ -2,6 +2,67 @@ import { memo } from 'react';
22
33import NativeStyleImport from '../specs/RNMBXStyleImportNativeComponent' ;
44
5+ /**
6+ * Configuration options for the Mapbox Standard style.
7+ *
8+ * These options are available when using `StyleImport` with `id="basemap"` and
9+ * a Standard style URL (e.g., `mapbox://styles/mapbox/standard`).
10+ */
11+ export type StandardStyleConfig = {
12+ /** Light preset: controls time-of-day lighting */
13+ lightPreset ?: 'dawn' | 'day' | 'dusk' | 'night' ;
14+ /** Color theme */
15+ theme ?: 'default' | 'faded' | 'monochrome' ;
16+ /** Font family for labels (e.g., 'Montserrat') */
17+ font ?: string ;
18+ /** Show generic 3D objects */
19+ show3dObjects ?: boolean ;
20+ /** Show extruded 3D buildings */
21+ show3dBuildings ?: boolean ;
22+ /** Show 3D building facades (v11.16+) */
23+ show3dFacades ?: boolean ;
24+ /** Show 3D landmarks (v11.16+) */
25+ show3dLandmarks ?: boolean ;
26+ /** Show 3D trees (v11.17+) */
27+ show3dTrees ?: boolean ;
28+ /** Show point of interest labels */
29+ showPointOfInterestLabels ?: boolean ;
30+ /** Show transit labels */
31+ showTransitLabels ?: boolean ;
32+ /** Show place labels */
33+ showPlaceLabels ?: boolean ;
34+ /** Show road labels */
35+ showRoadLabels ?: boolean ;
36+ /** Show pedestrian roads */
37+ showPedestrianRoads ?: boolean ;
38+ /** Color override for buildings (v11.18+) */
39+ colorBuildings ?: string ;
40+ /** Color override for commercial areas (v11.18+) */
41+ colorCommercial ?: string ;
42+ /** Color override for education areas (v11.18+) */
43+ colorEducation ?: string ;
44+ /** Color override for industrial areas (v11.18+) */
45+ colorIndustrial ?: string ;
46+ /** Color override for land (v11.18+) */
47+ colorLand ?: string ;
48+ /** Color override for medical areas (v11.18+) */
49+ colorMedical ?: string ;
50+ /** Color override for roads (v11.18+) */
51+ colorRoads ?: string ;
52+ /** Color override for motorways (v11.18+) */
53+ colorMotorways ?: string ;
54+ /** Color override for water (v11.18+) */
55+ colorWater ?: string ;
56+ /** Color override for greenspaces (v11.18+) */
57+ colorGreenspaces ?: string ;
58+ /** Color override for boundaries (v11.18+) */
59+ colorBoundaries ?: string ;
60+ } ;
61+
62+ type StyleImportConfig = StandardStyleConfig & {
63+ [ key : string ] : string | boolean | undefined ;
64+ } ;
65+
566type Props = {
667 /**
768 * id of the style import (eg. basemap)
@@ -16,11 +77,12 @@ type Props = {
1677 /**
1778 * config is a dictionary of configuration options for the style import.
1879 *
80+ * When using the Mapbox Standard style with `id="basemap"`, use {@link StandardStyleConfig}
81+ * keys for autocomplete. Arbitrary keys are also accepted for forward compatibility.
82+ *
1983 * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style
2084 */
21- config : {
22- [ key : string ] : string ;
23- } ;
85+ config : StyleImportConfig ;
2486} ;
2587
2688/**
@@ -29,5 +91,10 @@ type Props = {
2991 * See https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Documentation.docc/Migrate%20to%20v11.md#21-the-mapbox-standard-style
3092 */
3193export default memo ( ( props : Props ) => {
32- return < NativeStyleImport { ...props } /> ;
94+ return (
95+ < NativeStyleImport
96+ { ...props }
97+ config = { props . config as unknown as { [ key : string ] : string } }
98+ />
99+ ) ;
33100} ) ;
0 commit comments