@@ -76,7 +76,7 @@ export function intoNativeMarkerOptions(options: MarkerOptions) {
7676 opts . icon ( com . google . android . gms . maps . model . BitmapDescriptorFactory . defaultMarker ( hueFromColor ( color ) ) ) ;
7777 }
7878
79- if ( typeof options ?. opacity === 'number' ) {
79+ if ( typeof options ?. opacity === 'number' ) {
8080 opts . alpha ( options . opacity ) ;
8181 }
8282
@@ -153,14 +153,15 @@ export function intoNativePolygonOptions(options: PolygonOptions) {
153153 }
154154
155155 if ( Array . isArray ( options ?. holes ) ) {
156- const holes = new java . util . ArrayList ( ) ;
157156 options . holes . forEach ( ( hole ) => {
158- holes . add ( new com . google . android . gms . maps . model . LatLng ( hole . lat , hole . lng ) ) ;
157+ if ( Array . isArray ( hole ) && hole . length ) {
158+ const nativeHole = new java . util . ArrayList < com . google . android . gms . maps . model . LatLng > ( ) ;
159+ hole . forEach ( ( coordinate ) => {
160+ nativeHole . add ( new com . google . android . gms . maps . model . LatLng ( coordinate . lat , coordinate . lng ) ) ;
161+ } ) ;
162+ opts . addHole ( nativeHole ) ;
163+ }
159164 } ) ;
160-
161- if ( options . holes . length ) {
162- opts . addHole ( holes ) ;
163- }
164165 }
165166
166167 if ( typeof options ?. tappable === 'boolean' ) {
@@ -275,10 +276,7 @@ export function intoNativeGroundOverlayOptions(options: GroundOverlayOptions) {
275276 }
276277
277278 if ( options ?. bounds ) {
278- opts . positionFromBounds ( new com . google . android . gms . maps . model . LatLngBounds (
279- new com . google . android . gms . maps . model . LatLng ( options . bounds . southwest . lat , options . bounds . southwest . lng ) ,
280- new com . google . android . gms . maps . model . LatLng ( options . bounds . northeast . lat , options . bounds . northeast . lng )
281- ) ) ;
279+ opts . positionFromBounds ( new com . google . android . gms . maps . model . LatLngBounds ( new com . google . android . gms . maps . model . LatLng ( options . bounds . southwest . lat , options . bounds . southwest . lng ) , new com . google . android . gms . maps . model . LatLng ( options . bounds . northeast . lat , options . bounds . northeast . lng ) ) ) ;
282280 }
283281
284282 if ( typeof options ?. transparency ) {
0 commit comments