@@ -46,6 +46,29 @@ export interface MapControlsProps {
4646 enabled : boolean ,
4747 buttonEnabled : boolean
4848 ) => void ;
49+ // UI Settings
50+ readonly compassEnabled ?: boolean ;
51+ readonly onCompassEnabledChange ?: ( enabled : boolean ) => void ;
52+ readonly mapToolbarEnabled ?: boolean ;
53+ readonly onMapToolbarEnabledChange ?: ( enabled : boolean ) => void ;
54+ readonly indoorEnabled ?: boolean ;
55+ readonly onIndoorEnabledChange ?: ( enabled : boolean ) => void ;
56+ readonly indoorLevelPickerEnabled ?: boolean ;
57+ readonly onIndoorLevelPickerEnabledChange ?: ( enabled : boolean ) => void ;
58+ readonly rotateGesturesEnabled ?: boolean ;
59+ readonly onRotateGesturesEnabledChange ?: ( enabled : boolean ) => void ;
60+ readonly scrollGesturesEnabled ?: boolean ;
61+ readonly onScrollGesturesEnabledChange ?: ( enabled : boolean ) => void ;
62+ readonly scrollGesturesDuringRotateOrZoomEnabled ?: boolean ;
63+ readonly onScrollGesturesDuringRotateOrZoomEnabledChange ?: (
64+ enabled : boolean
65+ ) => void ;
66+ readonly tiltGesturesEnabled ?: boolean ;
67+ readonly onTiltGesturesEnabledChange ?: ( enabled : boolean ) => void ;
68+ readonly zoomControlsEnabled ?: boolean ;
69+ readonly onZoomControlsEnabledChange ?: ( enabled : boolean ) => void ;
70+ readonly zoomGesturesEnabled ?: boolean ;
71+ readonly onZoomGesturesEnabledChange ?: ( enabled : boolean ) => void ;
4972}
5073
5174export const defaultZoom : number = 15 ;
@@ -59,6 +82,27 @@ const MapsControls: React.FC<MapControlsProps> = ({
5982 myLocationEnabled = false ,
6083 myLocationButtonEnabled : _myLocationButtonEnabled = true ,
6184 onMyLocationChange,
85+ // UI Settings
86+ compassEnabled = true ,
87+ onCompassEnabledChange,
88+ mapToolbarEnabled = true ,
89+ onMapToolbarEnabledChange,
90+ indoorEnabled = true ,
91+ onIndoorEnabledChange,
92+ indoorLevelPickerEnabled = true ,
93+ onIndoorLevelPickerEnabledChange,
94+ rotateGesturesEnabled = true ,
95+ onRotateGesturesEnabledChange,
96+ scrollGesturesEnabled = true ,
97+ onScrollGesturesEnabledChange,
98+ scrollGesturesDuringRotateOrZoomEnabled = true ,
99+ onScrollGesturesDuringRotateOrZoomEnabledChange,
100+ tiltGesturesEnabled = true ,
101+ onTiltGesturesEnabledChange,
102+ zoomControlsEnabled = true ,
103+ onZoomControlsEnabledChange,
104+ zoomGesturesEnabled = true ,
105+ onZoomGesturesEnabledChange,
62106} ) => {
63107 const mapTypeOptions = [ 'None' , 'Normal' , 'Satellite' , 'Terrain' , 'Hybrid' ] ;
64108 const colorSchemeOptions = [ 'Follow System' , 'Light' , 'Dark' ] ;
@@ -141,7 +185,21 @@ const MapsControls: React.FC<MapControlsProps> = ({
141185
142186 const getUiSettings = async ( ) => {
143187 const result = await mapViewController . getUiSettings ( ) ;
144- showSnackbar ( `UI Settings: compass=${ result . isCompassEnabled } ` ) ;
188+ showSnackbar (
189+ `UI Settings:\n` +
190+ `- Compass: ${ result . isCompassEnabled } \n` +
191+ `- Map Toolbar: ${ result . isMapToolbarEnabled } \n` +
192+ `- Indoor Picker: ${ result . isIndoorLevelPickerEnabled } \n` +
193+ `- Rotate: ${ result . isRotateGesturesEnabled } \n` +
194+ `- Scroll: ${ result . isScrollGesturesEnabled } \n` +
195+ `- Scroll (rotate/zoom): ${ result . isScrollGesturesEnabledDuringRotateOrZoom } \n` +
196+ `- Tilt: ${ result . isTiltGesturesEnabled } \n` +
197+ `- Zoom Controls: ${ result . isZoomControlsEnabled } \n` +
198+ `- Zoom Gestures: ${ result . isZoomGesturesEnabled } ` ,
199+ 5000 ,
200+ true ,
201+ 12
202+ ) ;
145203 } ;
146204
147205 const getIsMyLocationEnabled = async ( ) => {
@@ -246,9 +304,9 @@ const MapsControls: React.FC<MapControlsProps> = ({
246304 } ;
247305
248306 /**
249- * Add a ground overlay using position -based positioning.
307+ * Add a ground overlay using location -based positioning.
250308 * This uses a location with width/height in meters.
251- * Note: On iOS, zoomLevel is required for position -based overlays.
309+ * Note: On iOS, zoomLevel is required for location -based overlays.
252310 */
253311 const addGroundOverlayWithPosition = async ( ) => {
254312 const cameraPosition = await mapViewController . getCameraPosition ( ) ;
@@ -472,13 +530,99 @@ const MapsControls: React.FC<MapControlsProps> = ({
472530 } }
473531 />
474532 </ View >
533+ < View style = { ControlStyles . rowContainer } >
534+ < Text style = { ControlStyles . rowLabel } > Compass</ Text >
535+ < ExampleAppButton
536+ title = { compassEnabled ? 'Disable' : 'Enable' }
537+ onPress = { ( ) => onCompassEnabledChange ?.( ! compassEnabled ) }
538+ />
539+ </ View >
540+ < View style = { ControlStyles . rowContainer } >
541+ < Text style = { ControlStyles . rowLabel } > Map Toolbar</ Text >
542+ < ExampleAppButton
543+ title = { mapToolbarEnabled ? 'Disable' : 'Enable' }
544+ onPress = { ( ) => onMapToolbarEnabledChange ?.( ! mapToolbarEnabled ) }
545+ />
546+ </ View >
547+ < View style = { ControlStyles . rowContainer } >
548+ < Text style = { ControlStyles . rowLabel } > Indoor Maps</ Text >
549+ < ExampleAppButton
550+ title = { indoorEnabled ? 'Disable' : 'Enable' }
551+ onPress = { ( ) => onIndoorEnabledChange ?.( ! indoorEnabled ) }
552+ />
553+ </ View >
554+ < View style = { ControlStyles . rowContainer } >
555+ < Text style = { ControlStyles . rowLabel } > Indoor Picker</ Text >
556+ < ExampleAppButton
557+ title = { indoorLevelPickerEnabled ? 'Disable' : 'Enable' }
558+ onPress = { ( ) =>
559+ onIndoorLevelPickerEnabledChange ?.( ! indoorLevelPickerEnabled )
560+ }
561+ />
562+ </ View >
475563 < ExampleAppButton title = "Get UI Settings" onPress = { getUiSettings } />
476564 < ExampleAppButton title = "Get My location" onPress = { getMyLocation } />
477565 < ExampleAppButton
478566 title = "Get My location enabled"
479567 onPress = { getIsMyLocationEnabled }
480568 />
481569 </ Accordion >
570+
571+ { /* Gestures */ }
572+ < Accordion title = "Gesture Settings" >
573+ < View style = { ControlStyles . rowContainer } >
574+ < Text style = { ControlStyles . rowLabel } > Rotate gestures</ Text >
575+ < ExampleAppButton
576+ title = { rotateGesturesEnabled ? 'Disable' : 'Enable' }
577+ onPress = { ( ) =>
578+ onRotateGesturesEnabledChange ?.( ! rotateGesturesEnabled )
579+ }
580+ />
581+ </ View >
582+ < View style = { ControlStyles . rowContainer } >
583+ < Text style = { ControlStyles . rowLabel } > Scroll gestures</ Text >
584+ < ExampleAppButton
585+ title = { scrollGesturesEnabled ? 'Disable' : 'Enable' }
586+ onPress = { ( ) =>
587+ onScrollGesturesEnabledChange ?.( ! scrollGesturesEnabled )
588+ }
589+ />
590+ </ View >
591+ < View style = { ControlStyles . rowContainer } >
592+ < Text style = { ControlStyles . rowLabel } > Scroll during rotate/zoom</ Text >
593+ < ExampleAppButton
594+ title = {
595+ scrollGesturesDuringRotateOrZoomEnabled ? 'Disable' : 'Enable'
596+ }
597+ onPress = { ( ) =>
598+ onScrollGesturesDuringRotateOrZoomEnabledChange ?.(
599+ ! scrollGesturesDuringRotateOrZoomEnabled
600+ )
601+ }
602+ />
603+ </ View >
604+ < View style = { ControlStyles . rowContainer } >
605+ < Text style = { ControlStyles . rowLabel } > Tilt gestures</ Text >
606+ < ExampleAppButton
607+ title = { tiltGesturesEnabled ? 'Disable' : 'Enable' }
608+ onPress = { ( ) => onTiltGesturesEnabledChange ?.( ! tiltGesturesEnabled ) }
609+ />
610+ </ View >
611+ < View style = { ControlStyles . rowContainer } >
612+ < Text style = { ControlStyles . rowLabel } > Zoom controls</ Text >
613+ < ExampleAppButton
614+ title = { zoomControlsEnabled ? 'Disable' : 'Enable' }
615+ onPress = { ( ) => onZoomControlsEnabledChange ?.( ! zoomControlsEnabled ) }
616+ />
617+ </ View >
618+ < View style = { ControlStyles . rowContainer } >
619+ < Text style = { ControlStyles . rowLabel } > Zoom gestures</ Text >
620+ < ExampleAppButton
621+ title = { zoomGesturesEnabled ? 'Disable' : 'Enable' }
622+ onPress = { ( ) => onZoomGesturesEnabledChange ?.( ! zoomGesturesEnabled ) }
623+ />
624+ </ View >
625+ </ Accordion >
482626 </ View >
483627 ) ;
484628} ;
0 commit comments