From fa6392d2687010b11ef4768f3f163941a19affcb Mon Sep 17 00:00:00 2001 From: Patrick Reames Date: Mon, 28 Aug 2017 00:11:23 -0500 Subject: [PATCH 1/2] mapbox-gl: GeolocateControl support v0.39.0 :warning: Breaking changes GeolocateControl breaking changes https://github.com/mapbox/mapbox-gl-js/pull/4479 The option watchPosition has been replaced with trackUserLocation The camera operation has changed from jumpTo (not animated) to fitBounds (animated). An effect of this is the map pitch is no longer reset, although the bearing is still reset to 0. The accuracy of the geolocation provided by the device is used to set the view (previously it was fixed at zoom level 17). The maxZoom can be controlled via the new fitBoundsOptions option (defaults to 15). New option showUserLocation to draw a "dot" as a Marker on the map at the user's location --- types/mapbox-gl/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index c2a9a3d41e..0f74cae466 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Mapbox GL JS v0.39.1 // Project: https://github.com/mapbox/mapbox-gl-js -// Definitions by: Dominik Bruderer +// Definitions by: Dominik Bruderer , Patrick Reames // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -395,12 +395,16 @@ declare namespace mapboxgl { timeout?: number; maximumAge?: number; } + + export class FitBoundsOptions { + maxZoom?: number; + } /** * Geolocate */ export class GeolocateControl extends Control { - constructor(options?: {positionOptions?: PositionOptions, watchPosition?: boolean}); + constructor(options?: {positionOptions?: PositionOptions, fitBoundsOptions?: FitBoundsOptions, trackUserLocation?: boolean, showUserLocation?: boolean}); } /** From ab49000acf83ab669671147dbc96631ef6030269 Mon Sep 17 00:00:00 2001 From: Patrick Reames Date: Mon, 28 Aug 2017 00:27:47 -0500 Subject: [PATCH 2/2] mapbox-gl: support pitch-alignment v0.39.0 Add new icon-pitch-alignment and circle-pitch-alignment properties https://github.com/mapbox/mapbox-gl-js/pull/4869 https://github.com/mapbox/mapbox-gl-js/pull/4871 --- types/mapbox-gl/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 0f74cae466..015aa21bce 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -995,6 +995,7 @@ declare namespace mapboxgl { "icon-ignore-placement"?: boolean; "icon-optional"?: boolean; "icon-rotation-alignment"?: "map" | "viewport" | "auto"; + "icon-pitch-alignment"?: "map" | "viewport"| "auto"; "icon-size"?: number | StyleFunction; "icon-text-fit"?: "none" | "both" | "width" | "height"; "icon-text-fit-padding"?: number[]; @@ -1068,6 +1069,7 @@ declare namespace mapboxgl { "circle-translate"?: number[]; "circle-translate-anchor"?: "map" | "viewport"; "circle-pitch-scale"?: "map" | "viewport"; + "circle-pitch-alignment"?: "map" | "viewport"; "circle-stroke-width"?: number | StyleFunction; "circle-stroke-color"?: string | StyleFunction; "circle-stroke-opacity"?: number | StyleFunction;