itowns 2.44.3-next.33 → 2.44.3-next.35

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.
@@ -13,13 +13,19 @@ globalExtentTMS.set('EPSG:4326', extent4326);
13
13
  const extent3857 = extent4326.as('EPSG:3857');
14
14
  extent3857.clampSouthNorth(extent3857.west, extent3857.east);
15
15
  globalExtentTMS.set('EPSG:3857', extent3857);
16
- schemeTiles.set('default', new THREE.Vector2(1, 1));
17
- schemeTiles.set('EPSG:3857', schemeTiles.get('default'));
16
+ const defaultScheme = new THREE.Vector2(1, 1);
17
+ schemeTiles.set('EPSG:3857', defaultScheme);
18
18
  schemeTiles.set('EPSG:4326', new THREE.Vector2(2, 1));
19
- export function getInfoTms(/** @type {string} */crs) {
19
+
20
+ // TODO: For now we can only have a single TMS grid per proj4 identifier.
21
+ // This causes TMS identifier to be proj4 identifier.
22
+ export function getInfoTms(crs) {
20
23
  const globalExtent = globalExtentTMS.get(crs);
24
+ if (!globalExtent) {
25
+ throw new Error(`The tile matrix set ${crs} is not defined.`);
26
+ }
21
27
  const globalDimension = globalExtent.planarDimensions(_dim);
22
- const sTs = schemeTiles.get(crs) || schemeTiles.get('default');
28
+ const sTs = schemeTiles.get(crs) ?? defaultScheme;
23
29
  // The isInverted parameter is to be set to the correct value, true or false
24
30
  // (default being false) if the computation of the coordinates needs to be
25
31
  // inverted to match the same scheme as OSM, Google Maps or other system.
@@ -35,8 +41,8 @@ export function getInfoTms(/** @type {string} */crs) {
35
41
  isInverted
36
42
  };
37
43
  }
38
- export function getCountTiles(/** @type {string} */crs, /** @type {number} */zoom) {
39
- const sTs = schemeTiles.get(crs) || schemeTiles.get('default');
44
+ export function getCountTiles(crs, zoom) {
45
+ const sTs = schemeTiles.get(crs) || defaultScheme;
40
46
  const count = 2 ** zoom;
41
47
  _countTiles.set(count, count).multiply(sTs);
42
48
  return _countTiles;
@@ -121,7 +121,7 @@ class Source extends InformationsData {
121
121
  this.whenReady = Promise.resolve();
122
122
  this._featuresCaches = {};
123
123
  if (source.extent && !source.extent.isExtent) {
124
- this.extent = new Extent(this.crs, source.extent);
124
+ this.extent = new Extent(this.crs).setFromExtent(source.extent);
125
125
  } else {
126
126
  this.extent = source.extent;
127
127
  }
@@ -1,5 +1,5 @@
1
1
  import { featureFilter } from '@maplibre/maplibre-gl-style-spec';
2
- import Style from "../Core/Style.js";
2
+ import StyleOptions from "../Core/StyleOptions.js";
3
3
  import TMSSource from "./TMSSource.js";
4
4
  import URLBuilder from "../Provider/URLBuilder.js";
5
5
  import Fetcher from "../Provider/Fetcher.js";
@@ -112,7 +112,7 @@ class VectorTilesSource extends TMSSource {
112
112
  if (layer['source-layer'] === undefined) {
113
113
  getPropertiesFromRefLayer(mvtStyle.layers, layer);
114
114
  }
115
- const style = Style.setFromVectorTileLayer(layer, this.sprites, this.symbolToCircle);
115
+ const style = StyleOptions.setFromVectorTileLayer(layer, this.sprites, this.symbolToCircle);
116
116
  this.styles[layer.id] = style;
117
117
  if (!this.layers[layer['source-layer']]) {
118
118
  this.layers[layer['source-layer']] = [];
@@ -1,7 +1,7 @@
1
1
  import Source from "./Source.js";
2
2
  import URLBuilder from "../Provider/URLBuilder.js";
3
3
  import Extent from "../Core/Geographic/Extent.js";
4
- const _extent = new Extent('EPSG:4326', [0, 0, 0, 0]);
4
+ const _extent = new Extent('EPSG:4326');
5
5
 
6
6
  /**
7
7
  * An object defining the source of resources to get from a
@@ -2,7 +2,7 @@ import Source from "./Source.js";
2
2
  import URLBuilder from "../Provider/URLBuilder.js";
3
3
  import Extent from "../Core/Geographic/Extent.js";
4
4
  import * as CRS from "../Core/Geographic/Crs.js";
5
- const _extent = new Extent('EPSG:4326', [0, 0, 0, 0]);
5
+ const _extent = new Extent('EPSG:4326');
6
6
 
7
7
  /**
8
8
  * Proj provides an optional param to define axis order and orientation for a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itowns",
3
- "version": "2.44.3-next.33",
3
+ "version": "2.44.3-next.35",
4
4
  "description": "A JS/WebGL framework for 3D geospatial data visualization",
5
5
  "type": "module",
6
6
  "main": "lib/Main.js",