mapbox-gl: GeolocateControl support v0.39.0

⚠️ 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
This commit is contained in:
Patrick Reames
2017-08-28 00:11:23 -05:00
committed by GitHub
parent b84df2925f
commit fa6392d268
+6 -2
View File
@@ -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 <https://github.com/dobrud>
// Definitions by: Dominik Bruderer <https://github.com/dobrud>, Patrick Reames <https://github.com/patrickr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="geojson" />
@@ -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});
}
/**