diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 520f267b5f..f334304224 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.42.2 +// Type definitions for Mapbox GL JS v0.43.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer , Patrick Reames // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -57,9 +57,9 @@ declare namespace mapboxgl { unproject(point: PointLike): mapboxgl.LngLat; - queryRenderedFeatures(pointOrBox?: PointLike | PointLike[], parameters?: { layers?: string[], filter?: any[] }): GeoJSON.Feature[]; + queryRenderedFeatures(pointOrBox?: PointLike | PointLike[], parameters?: { layers?: string[], filter?: any[] }): GeoJSON.Feature[]; - querySourceFeatures(sourceID: string, parameters?: { sourceLayer?: string, filter?: any[] }): GeoJSON.Feature[]; + querySourceFeatures(sourceID: string, parameters?: { sourceLayer?: string, filter?: any[] }): GeoJSON.Feature[]; setStyle(style: mapboxgl.Style | string): this; @@ -79,6 +79,8 @@ declare namespace mapboxgl { addImage(name: string, image: HTMLImageElement | ArrayBufferView, options?: { width?: number, height?: number, pixelRatio?: number }): this; + hasImage(name: string): boolean; + removeImage(name: string): this; loadImage(url: string, callback: Function): this; @@ -93,7 +95,7 @@ declare namespace mapboxgl { setFilter(layer: string, filter?: any[]): this; - setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this; + setLayerZoomRange(layerId: string, minzoom?: number, maxzoom?: number): this; getFilter(layer: string): any[]; @@ -499,6 +501,8 @@ declare namespace mapboxgl { type: 'vector' | 'raster' | 'geojson' | 'image' | 'video' | 'canvas'; } + export type GeoJSONGeometry = GeoJSON.Point | GeoJSON.LineString | GeoJSON.MultiPoint | GeoJSON.Polygon | GeoJSON.MultiLineString | GeoJSON.MultiPolygon | GeoJSON.GeometryCollection; + /** * GeoJSONSource */ @@ -512,11 +516,11 @@ declare namespace mapboxgl { constructor(options?: mapboxgl.GeoJSONSourceOptions); - setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; + setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; } export interface GeoJSONSourceOptions { - data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; + data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; maxzoom?: number; @@ -753,6 +757,10 @@ declare namespace mapboxgl { getPopup(): Popup; + getOffset(): PointLike; + + setOffset(offset: PointLike): this; + togglePopup(): this; }