From ce6ecda5cd04202625f4176872854ce810dff52d Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 3 May 2017 19:36:44 +0100 Subject: [PATCH] Add support for gestureHandling for Google Maps (#16287) Add support for the gestureHandling property on the MapOptions interface. --- types/googlemaps/googlemaps-tests.ts | 1 + types/googlemaps/index.d.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index f57a4e80e0..20d2bc51c8 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -11,6 +11,7 @@ let map = new google.maps.Map( fullscreenControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP }, + gestureHandling: "cooperative", scrollwheel: true, zoom: 4 }); diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 1ca49880c9..0e12a8e643 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Maps JavaScript API 3.26 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov , Michael McMullin +// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov , Michael McMullin , Martin Costello // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -95,6 +95,10 @@ declare namespace google.maps { fullscreenControl?: boolean; /** The display options for the Fullscreen control. */ fullscreenControlOptions?: FullscreenControlOptions; + /** + * This setting controls how gestures on the map are handled. + */ + gestureHandling?: GestureHandlingOptions; /** * The heading for aerial imagery in degrees measured clockwise from cardinal * direction North. Headings are snapped to the nearest available angle for @@ -250,6 +254,12 @@ declare namespace google.maps { opened?: boolean; } + export type GestureHandlingOptions = + "cooperative" | + "greedy" | + "none" | + "auto"; + /** Options for the rendering of the pan control. */ export interface PanControlOptions { /**