@@ -41,6 +41,8 @@ const MapsControls: React.FC<MapControlsProps> = ({ mapViewController }) => {
4141 const [ enableLocationMarker , setEnableLocationMarker ] = useState ( true ) ;
4242 const [ latitude , onLatChanged ] = useState ( '' ) ;
4343 const [ longitude , onLngChanged ] = useState ( '' ) ;
44+ const [ horizontalPadding , setHorizontalPadding ] = useState ( '' ) ;
45+ const [ verticalPadding , setVerticalPadding ] = useState ( '' ) ;
4446
4547 useEffect ( ( ) => {
4648 if ( zoom !== null ) {
@@ -195,6 +197,26 @@ const MapsControls: React.FC<MapControlsProps> = ({ mapViewController }) => {
195197 mapViewController . clearMapView ( ) ;
196198 } ;
197199
200+ const onHorizontalPaddingChanged = ( padding : string ) => {
201+ mapViewController . setPadding (
202+ Number ( verticalPadding ) ,
203+ Number ( padding ) ,
204+ Number ( verticalPadding ) ,
205+ Number ( padding )
206+ ) ;
207+ setHorizontalPadding ( padding ) ;
208+ } ;
209+
210+ const onVerticalPaddingChanged = ( padding : string ) => {
211+ mapViewController . setPadding (
212+ Number ( padding ) ,
213+ Number ( horizontalPadding ) ,
214+ Number ( padding ) ,
215+ Number ( horizontalPadding )
216+ ) ;
217+ setVerticalPadding ( padding ) ;
218+ } ;
219+
198220 return (
199221 < View >
200222 < TextInput
@@ -280,6 +302,22 @@ const MapsControls: React.FC<MapControlsProps> = ({ mapViewController }) => {
280302 dropdownStyle = { styles . dropdownMenuStyle }
281303 />
282304 </ View >
305+ < TextInput
306+ style = { styles . input }
307+ onChangeText = { onHorizontalPaddingChanged }
308+ value = { horizontalPadding }
309+ placeholder = "Horizontal padding"
310+ placeholderTextColor = "#000"
311+ keyboardType = "numeric"
312+ />
313+ < TextInput
314+ style = { styles . input }
315+ onChangeText = { onVerticalPaddingChanged }
316+ value = { verticalPadding }
317+ placeholder = "Vertical padding"
318+ placeholderTextColor = "#000"
319+ keyboardType = "numeric"
320+ />
283321 </ View >
284322 ) ;
285323} ;
0 commit comments