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.
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/lib/Converter/textureConverter.js +1 -1
- package/lib/Core/Feature.js +2 -2
- package/lib/Core/Geographic/Extent.js +171 -152
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +1 -1
- package/lib/Core/Style.js +0 -482
- package/lib/Core/StyleOptions.js +486 -0
- package/lib/Core/Tile/Tile.js +39 -51
- package/lib/Core/Tile/TileGrid.js +12 -6
- package/lib/Source/Source.js +1 -1
- package/lib/Source/VectorTilesSource.js +2 -2
- package/lib/Source/WFSSource.js +1 -1
- package/lib/Source/WMSSource.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
17
|
-
schemeTiles.set('EPSG:3857',
|
|
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
|
-
|
|
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)
|
|
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(
|
|
39
|
-
const sTs = schemeTiles.get(crs) ||
|
|
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;
|
package/lib/Source/Source.js
CHANGED
|
@@ -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
|
|
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
|
|
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 =
|
|
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']] = [];
|
package/lib/Source/WFSSource.js
CHANGED
|
@@ -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'
|
|
4
|
+
const _extent = new Extent('EPSG:4326');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* An object defining the source of resources to get from a
|
package/lib/Source/WMSSource.js
CHANGED
|
@@ -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'
|
|
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
|