@@ -15,6 +15,7 @@ import {
1515} from 'react-native-google-maps-plus' ;
1616import type { ViewProps } from 'react-native' ;
1717import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
18+ import { callback } from 'react-native-nitro-modules' ;
1819
1920type Props = ViewProps &
2021 RNGoogleMapsPlusViewProps & {
@@ -94,86 +95,82 @@ export default function MapWrapper(props: Props) {
9495 mapZoomConfig = { props . mapZoomConfig ?? mapZoomConfig }
9596 mapPadding = { props . mapPadding ?? mapPadding }
9697 locationConfig = { props . locationConfig ?? locationConfig }
97- onMapReady = {
98- props . onMapReady
99- ? {
100- f : ( ready : boolean ) => console . log ( 'Map is ready! ' + ready ) ,
101- }
102- : undefined
103- }
104- onMapPress = {
105- props . onMapPress
106- ? {
107- f : ( c : RNLatLng ) => console . log ( 'Map press:' , c ) ,
108- }
109- : undefined
110- }
111- onMarkerPress = {
112- props . onMarkerPress
113- ? {
114- f : ( id : string ) => console . log ( 'Marker press:' , id ) ,
115- }
116- : undefined
117- }
118- onPolylinePress = {
119- props . onPolylinePress
120- ? {
121- f : ( id : string ) => console . log ( 'Polyline press:' , id ) ,
122- }
123- : undefined
124- }
125- onPolygonPress = {
126- props . onPolygonPress
127- ? {
128- f : ( id : string ) => console . log ( 'Polygon press:' , id ) ,
129- }
130- : undefined
131- }
132- onCirclePress = {
133- props . onCirclePress
134- ? {
135- f : ( id : string ) => console . log ( 'Circle press:' , id ) ,
136- }
137- : undefined
138- }
139- onCameraChangeStart = {
140- props . onCameraChangeStart
141- ? {
142- f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
143- console . log ( 'Cam start' , r , cam , g ) ,
144- }
145- : undefined
146- }
147- onCameraChange = {
148- props . onCameraChange
149- ? {
150- f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
151- console . log ( 'Cam' , r , cam , g ) ,
152- }
153- : undefined
154- }
155- onCameraChangeComplete = {
156- props . onCameraChangeComplete
157- ? {
158- f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
159- console . log ( 'Cam complete' , r , cam , g ) ,
160- }
161- : undefined
162- }
163- onLocationUpdate = {
164- props . onLocationUpdate
165- ? {
166- f : ( l : RNLocation ) => console . log ( 'Location' , l ) ,
167- }
168- : undefined
169- }
170- onLocationError = {
171- props . onLocationError
172- ? {
173- f : ( e : any ) => console . log ( 'Location error' , e ) ,
174- }
175- : undefined
176- }
98+ onMapReady = { callback (
99+ props . onMapReady ?? {
100+ f : ( ready : boolean ) => console . log ( 'Map is ready! ' + ready ) ,
101+ }
102+ ) }
103+ onMapPress = { callback (
104+ props . onMapPress ?? {
105+ f : ( c : RNLatLng ) => console . log ( 'Map press:' , c ) ,
106+ }
107+ ) }
108+ onMarkerPress = { callback (
109+ props . onMarkerPress ?? {
110+ f : ( id : string | undefined ) => console . log ( 'Marker press:' , id ) ,
111+ }
112+ ) }
113+ onPolylinePress = { callback (
114+ props . onPolylinePress ?? {
115+ f : ( id : string | undefined ) => console . log ( 'Polyline press:' , id ) ,
116+ }
117+ ) }
118+ onPolygonPress = { callback (
119+ props . onPolygonPress ?? {
120+ f : ( id : string | undefined ) => console . log ( 'Polygon press:' , id ) ,
121+ }
122+ ) }
123+ onCirclePress = { callback (
124+ props . onCirclePress ?? {
125+ f : ( id : string | undefined ) => console . log ( 'Circle press:' , id ) ,
126+ }
127+ ) }
128+ onMarkerDragStart = { callback (
129+ props . onMarkerDragStart ?? {
130+ f : ( id : string | undefined , latLng : RNLatLng ) =>
131+ console . log ( 'Marker drag start' , id , latLng ) ,
132+ }
133+ ) }
134+ onMarkerDrag = { callback (
135+ props . onMarkerDrag ?? {
136+ f : ( id : string | undefined , latLng : RNLatLng ) =>
137+ console . log ( 'Marker drag' , id , latLng ) ,
138+ }
139+ ) }
140+ onMarkerDragEnd = { callback (
141+ props . onMarkerDragEnd ?? {
142+ f : ( id : string | undefined , latLng : RNLatLng ) =>
143+ console . log ( 'Marker drag end' , id , latLng ) ,
144+ }
145+ ) }
146+ onCameraChangeStart = { callback (
147+ props . onCameraChangeStart ?? {
148+ f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
149+ console . log ( 'Cam start' , r , cam , g ) ,
150+ }
151+ ) }
152+ onCameraChange = { callback (
153+ props . onCameraChange ?? {
154+ f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
155+ console . log ( 'Cam' , r , cam , g ) ,
156+ }
157+ ) }
158+ onCameraChangeComplete = { callback (
159+ props . onCameraChangeComplete ?? {
160+ f : ( r : RNRegion , cam : RNCamera , g : boolean ) =>
161+ console . log ( 'Cam complete' , r , cam , g ) ,
162+ }
163+ ) }
164+ onLocationUpdate = { callback (
165+ props . onLocationUpdate ?? {
166+ f : ( l : RNLocation ) => console . log ( 'Location' , l ) ,
167+ }
168+ ) }
169+ onLocationError = { callback (
170+ props . onLocationError ?? {
171+ f : ( e : any ) => console . log ( 'Location error' , e ) ,
172+ }
173+ ) }
177174 />
178175 { children }
179176 </ View >
0 commit comments