Skip to content

Commit

Permalink
mapbox-gl: GeolocateControl support v0.39.0
Browse files Browse the repository at this point in the history
⚠️ Breaking changes

GeolocateControl breaking changes mapbox/mapbox-gl-js#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
  • Loading branch information
lora-reames authored Aug 28, 2017
1 parent b84df29 commit fa6392d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions types/mapbox-gl/index.d.ts
Original file line number Diff line number Diff line change
@@ -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" />
Expand Down Expand Up @@ -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});
}

/**
Expand Down

0 comments on commit fa6392d

Please sign in to comment.