From d8dc4b15ea5b6134a98d499bb61cb7ac145716bd Mon Sep 17 00:00:00 2001 From: Tommaso Guerri Date: Fri, 15 Jul 2022 11:56:21 +0200 Subject: [PATCH 1/3] fixes android ground overlay from position --- packages/google-maps/utils/index.android.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-maps/utils/index.android.ts b/packages/google-maps/utils/index.android.ts index 5ccd656f..38e17c05 100644 --- a/packages/google-maps/utils/index.android.ts +++ b/packages/google-maps/utils/index.android.ts @@ -253,6 +253,11 @@ export function intoNativePolylineOptions(options: PolylineOptions) { export function intoNativeGroundOverlayOptions(options: GroundOverlayOptions) { const opts = new com.google.android.gms.maps.model.GroundOverlayOptions(); + if (options?.position) { + const coords = options.position; + opts.position(new com.google.android.gms.maps.model.LatLng(coords.lat, coords.lng), options.width); + } + if (typeof options?.width === 'number') { opts.position(opts.getLocation(), options.width); } @@ -273,11 +278,6 @@ export function intoNativeGroundOverlayOptions(options: GroundOverlayOptions) { opts.clickable(options.tappable); } - if (options?.position) { - const coords = options.position; - opts.position(new com.google.android.gms.maps.model.LatLng(coords.lat, coords.lng), opts.getWidth()); - } - if (typeof options?.tappable === 'boolean') { opts.clickable(options.tappable); } From 30eab9902791cde06021e7229c364676b49ce5d5 Mon Sep 17 00:00:00 2001 From: Tommaso Guerri Date: Fri, 15 Jul 2022 11:57:44 +0200 Subject: [PATCH 2/3] adds ground overlay from bounds --- packages/google-maps/utils/index.android.ts | 7 +++++++ packages/google-maps/utils/index.ios.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/google-maps/utils/index.android.ts b/packages/google-maps/utils/index.android.ts index 38e17c05..122fb99c 100644 --- a/packages/google-maps/utils/index.android.ts +++ b/packages/google-maps/utils/index.android.ts @@ -266,6 +266,13 @@ export function intoNativeGroundOverlayOptions(options: GroundOverlayOptions) { opts.position(opts.getLocation(), opts.getWidth(), options.height); } + if (options?.bounds) { + 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) + )); + } + if (typeof options?.transparency) { opts.transparency(options.transparency); } diff --git a/packages/google-maps/utils/index.ios.ts b/packages/google-maps/utils/index.ios.ts index 5d18056b..a3b6eaf1 100644 --- a/packages/google-maps/utils/index.ios.ts +++ b/packages/google-maps/utils/index.ios.ts @@ -259,6 +259,13 @@ export function intoNativeGroundOverlayOptions(options: GroundOverlayOptions) { // TODO } + if (options?.bounds) { + opts.bounds = new GMSCoordinateBounds({ + coordinate: CLLocationCoordinate2DMake(options.bounds.southwest.lat, options.bounds.southwest.lng), + coordinate2: CLLocationCoordinate2DMake(options.bounds.northeast.lat, options.bounds.northeast.lng) + }); + } + if (typeof options?.anchorU === 'number' || typeof options?.anchorV === 'number') { opts.anchor = CGPointMake(options?.anchorU ?? opts.anchor.x, options?.anchorV ?? opts.anchor.y); } From e4b331dea0bb9d8df63d988726e9af66b57d0e87 Mon Sep 17 00:00:00 2001 From: Tommaso Guerri Date: Fri, 15 Jul 2022 11:58:11 +0200 Subject: [PATCH 3/3] fixes map style --- packages/google-maps/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-maps/index.d.ts b/packages/google-maps/index.d.ts index b3176dcf..2b761d0c 100644 --- a/packages/google-maps/index.d.ts +++ b/packages/google-maps/index.d.ts @@ -17,13 +17,15 @@ export type ElementTypeGeometry = 'geometry' | 'geometry.fill' | 'geometry.strok export type ElementTypeLabels = 'labels' | 'labels.icon' | 'labels.text' | 'labels.text.fill' | 'labels.text.stroke'; +export type StylersVisibility = 'on' | 'off' | 'simplified'; + export interface Stylers { hue?: string; lightness?: number; saturation?: number; gamma?: number; invert_lightness?: boolean; - visibility?: boolean; + visibility?: StylersVisibility; color?: string; weight?: number; } @@ -410,7 +412,7 @@ export interface IGoogleMap { } export class GoogleMap implements IGoogleMap { - mapStyle: Style; + mapStyle: Style[]; addTileOverlay(options: TileOverlayOptions): TileOverlay; removeTileOverlay(overlay: TileOverlay); buildingsEnabled: boolean;