mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
🤖 Merge PR #46865 [mapbox-gl] update to mapbox-gl 1.12 by @dmytro-gokun
This commit is contained in:
parent
392fb6935a
commit
a797941634
24
types/mapbox-gl/index.d.ts
vendored
24
types/mapbox-gl/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for Mapbox GL JS 1.11
|
||||
// Type definitions for Mapbox GL JS 1.12
|
||||
// Project: https://github.com/mapbox/mapbox-gl-js
|
||||
// Definitions by: Dominik Bruderer <https://github.com/dobrud>
|
||||
// Patrick Reames <https://github.com/patrickr>
|
||||
@ -1075,12 +1075,30 @@ declare namespace mapboxgl {
|
||||
| RasterSource
|
||||
| RasterDemSource;
|
||||
|
||||
interface VectorSourceImpl extends VectorSource {
|
||||
/**
|
||||
* Sets the source `tiles` property and re-renders the map.
|
||||
*
|
||||
* @param {string[]} tiles An array of one or more tile source URLs, as in the TileJSON spec.
|
||||
* @returns {VectorTileSource} this
|
||||
*/
|
||||
setTiles(tiles: ReadonlyArray<string>): VectorSourceImpl;
|
||||
|
||||
/**
|
||||
* Sets the source `url` property and re-renders the map.
|
||||
*
|
||||
* @param {string} url A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`.
|
||||
* @returns {VectorTileSource} this
|
||||
*/
|
||||
setUrl(url: string): VectorSourceImpl;
|
||||
}
|
||||
|
||||
export type AnySourceImpl =
|
||||
| GeoJSONSource
|
||||
| VideoSource
|
||||
| ImageSource
|
||||
| CanvasSource
|
||||
| VectorSource
|
||||
| VectorSourceImpl
|
||||
| RasterSource
|
||||
| RasterDemSource;
|
||||
|
||||
@ -1147,6 +1165,8 @@ declare namespace mapboxgl {
|
||||
generateId?: boolean;
|
||||
|
||||
promoteId?: PromoteIdSpecification;
|
||||
|
||||
filter?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -124,6 +124,7 @@ map.on('load', function () {
|
||||
clusterMinPoints: 8,
|
||||
clusterRadius: 50, // Radius of each cluster when clustering points (defaults to 50)
|
||||
clusterProperties: { sum: ['+', ['get', 'property']] },
|
||||
filter: 'something',
|
||||
});
|
||||
|
||||
map.addLayer({
|
||||
@ -344,6 +345,15 @@ var videoSourceObj = new mapboxgl.VideoSource({
|
||||
map.addSource('some id', videoSourceObj); // add
|
||||
map.removeSource('some id'); // remove
|
||||
|
||||
/**
|
||||
* Vector Source
|
||||
*/
|
||||
const vectorSource = map.getSource('tile-source') as mapboxgl.VectorSourceImpl;
|
||||
// $ExpectType VectorSourceImpl
|
||||
vectorSource.setTiles(['a', 'b']);
|
||||
// $ExpectType VectorSourceImpl
|
||||
vectorSource.setUrl('https://github.com');
|
||||
|
||||
/**
|
||||
* Add Raster Source /// made URL optional to allow only tiles.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user