@deck.gl/carto 9.1.1 → 9.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.1.1",
6
+ "version": "9.1.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -37,7 +37,7 @@
37
37
  "sideEffects": false,
38
38
  "scripts": {
39
39
  "build-bundle": "npm run build-workers && ocular-bundle ./bundle.ts",
40
- "build-workers": "npm run build-worker --cartoloader=RasterTile && npm run build-worker --cartoloader=SpatialTile && npm run build-worker --cartoloader=VectorTile",
40
+ "build-workers": "npm run build-worker --cartoloader=RasterTile && npm run build-worker --cartoloader=SpatialTile && npm run build-worker --cartoloader=VectorTile && npm run build-worker --cartoloader=PropertiesTile",
41
41
  "build-worker": "esbuild src/workers/carto$npm_config_cartoloader.ts --bundle --outfile=dist/carto$npm_config_cartoloader-worker.js --define:__VERSION__=\\\"$npm_package_version\\\"",
42
42
  "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
43
43
  },
@@ -75,5 +75,5 @@
75
75
  "@loaders.gl/core": "^4.2.0",
76
76
  "@luma.gl/core": "^9.1.0"
77
77
  },
78
- "gitHead": "0f50055847e881ddd72b6b0f081bf8110b9a3a31"
78
+ "gitHead": "208df758c9ab85fab1b540593096109f6d5fc6a9"
79
79
  }
@@ -6,11 +6,27 @@ import {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
6
6
 
7
7
  import {Tile, TileReader} from './carto-properties-tile';
8
8
  import {parsePbf} from './tile-loader-utils';
9
+ import {getWorkerUrl} from '../../utils';
10
+
11
+ const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
12
+ const id = 'cartoPropertiesTile';
13
+
14
+ type CartoPropertiesTileLoaderOptions = LoaderOptions & {
15
+ cartoPropertiesTile?: {
16
+ workerUrl: string;
17
+ };
18
+ };
19
+
20
+ const DEFAULT_OPTIONS: CartoPropertiesTileLoaderOptions = {
21
+ cartoPropertiesTile: {
22
+ workerUrl: getWorkerUrl(id, VERSION)
23
+ }
24
+ };
9
25
 
10
26
  const CartoPropertiesTileLoader: LoaderWithParser = {
11
27
  name: 'CARTO Properties Tile',
12
- version: '1',
13
- id: 'cartoPropertiesTile',
28
+ version: VERSION,
29
+ id,
14
30
  module: 'carto',
15
31
  extensions: ['pbf'],
16
32
  mimeTypes: ['application/vnd.carto-properties-tile'],
@@ -18,7 +34,7 @@ const CartoPropertiesTileLoader: LoaderWithParser = {
18
34
  worker: true,
19
35
  parse: async (arrayBuffer, options) => parseCartoPropertiesTile(arrayBuffer, options),
20
36
  parseSync: parseCartoPropertiesTile,
21
- options: {}
37
+ options: DEFAULT_OPTIONS
22
38
  };
23
39
 
24
40
  function parseCartoPropertiesTile(arrayBuffer: ArrayBuffer, options?: LoaderOptions): Tile | null {
@@ -0,0 +1,8 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {createLoaderWorker} from '@loaders.gl/loader-utils';
6
+ import CartoPropertiesTileLoader from '../layers/schema/carto-properties-tile-loader';
7
+
8
+ createLoaderWorker(CartoPropertiesTileLoader);