|
2 | 2 | // SPDX-License-Identifier: MIT
|
3 | 3 | // Copyright (c) vis.gl contributors
|
4 | 4 |
|
5 |
| -import {CompositeLayer, CompositeLayerProps, Layer, LayersList, DefaultProps} from '@deck.gl/core'; |
| 5 | +import {CompositeLayer, CompositeLayerProps, DefaultProps} from '@deck.gl/core'; |
6 | 6 | import QuadbinLayer, {QuadbinLayerProps} from './quadbin-layer';
|
7 | 7 | import QuadbinTileset2D from './quadbin-tileset-2d';
|
8 | 8 | import SpatialIndexTileLayer, {SpatialIndexTileLayerProps} from './spatial-index-tile-layer';
|
9 | 9 | import {hexToBigInt} from 'quadbin';
|
10 | 10 | import type {TilejsonResult} from '@carto/api-client';
|
11 |
| -import {injectAccessToken, TilejsonPropType} from './utils'; |
| 11 | +import {TilejsonPropType, mergeLoadOptions} from './utils'; |
12 | 12 | import {DEFAULT_TILE_SIZE} from '../constants';
|
13 | 13 |
|
14 | 14 | export const renderSubLayers = props => {
|
@@ -43,11 +43,11 @@ export default class QuadbinTileLayer<
|
43 | 43 | static defaultProps = defaultProps;
|
44 | 44 |
|
45 | 45 | getLoadOptions(): any {
|
46 |
| - const loadOptions = super.getLoadOptions() || {}; |
47 | 46 | const tileJSON = this.props.data as TilejsonResult;
|
48 |
| - injectAccessToken(loadOptions, tileJSON.accessToken); |
49 |
| - loadOptions.cartoSpatialTile = {...loadOptions.cartoSpatialTile, scheme: 'quadbin'}; |
50 |
| - return loadOptions; |
| 47 | + return mergeLoadOptions(super.getLoadOptions(), { |
| 48 | + fetch: {headers: {Authorization: `Bearer ${tileJSON.accessToken}`}}, |
| 49 | + cartoSpatialTile: {scheme: 'quadbin'} |
| 50 | + }); |
51 | 51 | }
|
52 | 52 |
|
53 | 53 | renderLayers(): SpatialIndexTileLayer | null {
|
|
0 commit comments