getGeoAssetPath()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns the path and query of a geo asset URL, with its origin removed; undefined when the URL does not point at a geo asset.
export declare function getGeoAssetPath(url: string): string | undefined;
Parameters
Parameter | Type | Description |
|---|---|---|
url | string | absolute or relative URL; may still contain MapLibre template tokens such as |
Returns
string | undefined
Remarks
A style document can reference assets on third-party hosts, which must keep their URL and must never receive GoodData credentials. The check is anchored at the start of the path, so a third-party URL that only mentions GEO_ASSET_PATH further in (in a sub-path or a query) does not qualify. The returned path is what a backend implementation loads from its own host, so the origin found in the URL is never contacted with credentials.