-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(carto): Support filters parameter in rasterSource (#8928)
--------- Co-authored-by: Don McCurdy <[email protected]>
- Loading branch information
1 parent
5e247c6
commit 2d6dde3
Showing
3 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import {baseSource} from './base-source'; | ||
import type {SourceOptions, TilejsonResult, TilesetSourceOptions} from './types'; | ||
import type {FilterOptions, SourceOptions, TilejsonResult, TilesetSourceOptions} from './types'; | ||
|
||
export type RasterSourceOptions = SourceOptions & TilesetSourceOptions; | ||
type UrlParameters = {name: string}; | ||
export type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions; | ||
type UrlParameters = { | ||
name: string; | ||
filters?: Record<string, unknown>; | ||
}; | ||
|
||
export const rasterSource = async function (options: RasterSourceOptions): Promise<TilejsonResult> { | ||
const {tableName} = options; | ||
const {tableName, filters} = options; | ||
const urlParameters: UrlParameters = {name: tableName}; | ||
|
||
if (filters) { | ||
urlParameters.filters = filters; | ||
} | ||
return baseSource<UrlParameters>('raster', options, urlParameters) as Promise<TilejsonResult>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters