itowns 2.42.1-next.9 → 2.43.1-next.0
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/changelog.md +90 -0
- package/dist/debug.js +1 -1
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/{.eslintrc.js → .eslintrc.cjs} +1 -1
- package/examples/effects_stereo.html +2 -2
- package/examples/misc_collada.html +2 -2
- package/examples/source_stream_wfs_25d.html +11 -11
- package/examples/source_stream_wfs_3d.html +1 -1
- package/examples/view_25d_map.html +2 -2
- package/examples/view_3d_map.html +2 -2
- package/examples/view_3d_map_webxr.html +1 -1
- package/examples/view_3d_mns_map.html +2 -2
- package/examples/view_immersive.html +1 -1
- package/examples/view_multi_25d.html +2 -2
- package/examples/widgets_searchbar.html +2 -2
- package/lib/Controls/FirstPersonControls.js +5 -12
- package/lib/Controls/FlyControls.js +4 -13
- package/lib/Controls/GlobeControls.js +33 -43
- package/lib/Controls/PlanarControls.js +9 -20
- package/lib/Controls/StateControl.js +2 -11
- package/lib/Controls/StreetControls.js +14 -24
- package/lib/Converter/Feature2Mesh.js +28 -38
- package/lib/Converter/Feature2Texture.js +15 -25
- package/lib/Converter/convertToTile.js +16 -26
- package/lib/Converter/textureConverter.js +9 -19
- package/lib/Core/3DTiles/C3DTBatchTable.js +5 -13
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +1 -8
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +17 -27
- package/lib/Core/3DTiles/C3DTExtensions.js +1 -8
- package/lib/Core/3DTiles/C3DTFeature.js +3 -10
- package/lib/Core/3DTiles/C3DTilesEnums.js +3 -11
- package/lib/Core/3DTiles/C3DTileset.js +7 -16
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +5 -11
- package/lib/Core/AnimationPlayer.js +2 -11
- package/lib/Core/Deprecated/Undeprecator.js +9 -20
- package/lib/Core/EntwinePointTileNode.js +6 -16
- package/lib/Core/Feature.js +16 -30
- package/lib/Core/Geographic/CoordStars.js +3 -12
- package/lib/Core/Geographic/Coordinates.js +12 -22
- package/lib/Core/Geographic/Crs.js +7 -15
- package/lib/Core/Geographic/Extent.js +36 -47
- package/lib/Core/Geographic/GeoidGrid.js +6 -16
- package/lib/Core/Label.js +7 -17
- package/lib/Core/MainLoop.js +7 -16
- package/lib/Core/Math/Ellipsoid.js +6 -17
- package/lib/Core/Picking.js +10 -20
- package/lib/Core/PointCloudNode.js +2 -11
- package/lib/Core/PotreeNode.js +4 -13
- package/lib/Core/Prefab/Globe/Atmosphere.js +17 -26
- package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +6 -16
- package/lib/Core/Prefab/Globe/GlobeLayer.js +19 -28
- package/lib/Core/Prefab/Globe/SkyShader.js +2 -11
- package/lib/Core/Prefab/GlobeView.js +27 -45
- package/lib/Core/Prefab/Planar/PlanarLayer.js +11 -20
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +6 -16
- package/lib/Core/Prefab/PlanarView.js +10 -25
- package/lib/Core/Prefab/TileBuilder.js +13 -22
- package/lib/Core/Prefab/computeBufferTileGeometry.js +12 -16
- package/lib/Core/Scheduler/Cache.js +2 -10
- package/lib/Core/Scheduler/CancelledCommandException.js +1 -8
- package/lib/Core/Scheduler/Scheduler.js +15 -23
- package/lib/Core/Style.js +24 -38
- package/lib/Core/System/Capabilities.js +2 -13
- package/lib/Core/TileGeometry.js +13 -15
- package/lib/Core/TileMesh.js +6 -15
- package/lib/Core/View.js +43 -58
- package/lib/Layer/C3DTilesLayer.js +29 -41
- package/lib/Layer/ColorLayer.js +10 -16
- package/lib/Layer/ElevationLayer.js +7 -14
- package/lib/Layer/EntwinePointTileLayer.js +9 -18
- package/lib/Layer/FeatureGeometryLayer.js +9 -16
- package/lib/Layer/GeoidLayer.js +6 -15
- package/lib/Layer/GeometryLayer.js +11 -17
- package/lib/Layer/InfoLayer.js +5 -14
- package/lib/Layer/LabelLayer.js +22 -32
- package/lib/Layer/Layer.js +16 -26
- package/lib/Layer/LayerUpdateState.js +1 -8
- package/lib/Layer/LayerUpdateStrategy.js +7 -18
- package/lib/Layer/OrientedImageLayer.js +15 -25
- package/lib/Layer/PointCloudLayer.js +9 -19
- package/lib/Layer/PotreeLayer.js +8 -18
- package/lib/Layer/RasterLayer.js +9 -17
- package/lib/Layer/ReferencingLayerProperties.js +1 -8
- package/lib/Layer/TiledGeometryLayer.js +37 -33
- package/lib/Main.js +87 -708
- package/lib/MainBundle.js +4 -34
- package/lib/Parser/B3dmParser.js +80 -131
- package/lib/Parser/CameraCalibrationParser.js +5 -14
- package/lib/Parser/GDFParser.js +11 -22
- package/lib/Parser/GLTFParser.js +88 -0
- package/lib/Parser/GTXParser.js +9 -21
- package/lib/Parser/GeoJsonParser.js +14 -22
- package/lib/Parser/GpxParser.js +7 -14
- package/lib/Parser/ISGParser.js +19 -28
- package/lib/Parser/KMLParser.js +7 -14
- package/lib/Parser/LASLoader.js +20 -21
- package/lib/Parser/LASParser.js +6 -15
- package/lib/Parser/MapBoxUrlParser.js +2 -9
- package/lib/Parser/PntsParser.js +4 -14
- package/lib/Parser/PotreeBinParser.js +8 -16
- package/lib/Parser/PotreeCinParser.js +3 -12
- package/lib/Parser/ShapefileParser.js +11 -18
- package/lib/Parser/VectorTileParser.js +23 -31
- package/lib/Parser/XbilParser.js +5 -13
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +2 -12
- package/lib/Process/3dTilesProcessing.js +14 -27
- package/lib/Process/FeatureProcessing.js +14 -22
- package/lib/Process/LayeredMaterialNodeProcessing.js +14 -26
- package/lib/Process/ObjectRemovalHelper.js +2 -9
- package/lib/Process/handlerNodeError.js +1 -7
- package/lib/Provider/3dTilesProvider.js +32 -29
- package/lib/Provider/DataSourceProvider.js +2 -9
- package/lib/Provider/Fetcher.js +40 -22
- package/lib/Provider/PointCloudProvider.js +7 -19
- package/lib/Provider/TileProvider.js +4 -12
- package/lib/Provider/URLBuilder.js +4 -12
- package/lib/Renderer/Camera.js +7 -17
- package/lib/Renderer/Color.js +3 -11
- package/lib/Renderer/ColorLayersOrdering.js +14 -22
- package/lib/Renderer/CommonMaterial.js +3 -12
- package/lib/Renderer/Label2DRenderer.js +5 -16
- package/lib/Renderer/LayeredMaterial.js +33 -53
- package/lib/Renderer/OBB.js +12 -21
- package/lib/Renderer/OrientedImageCamera.js +2 -11
- package/lib/Renderer/OrientedImageMaterial.js +17 -35
- package/lib/Renderer/PointsMaterial.js +37 -60
- package/lib/Renderer/RasterTile.js +16 -29
- package/lib/Renderer/RenderMode.js +2 -9
- package/lib/Renderer/Shader/ShaderChunk.js +5 -23
- package/lib/Renderer/Shader/ShaderUtils.js +2 -9
- package/lib/Renderer/SphereHelper.js +2 -11
- package/lib/Renderer/WebXR.js +2 -11
- package/lib/Renderer/c3DEngine.js +20 -53
- package/lib/Source/C3DTilesGoogleSource.js +76 -0
- package/lib/Source/C3DTilesIonSource.js +6 -13
- package/lib/Source/C3DTilesSource.js +5 -12
- package/lib/Source/EntwinePointTileSource.js +12 -19
- package/lib/Source/FileSource.js +7 -14
- package/lib/Source/OrientedImageSource.js +6 -14
- package/lib/Source/PotreeSource.js +9 -16
- package/lib/Source/Source.js +26 -39
- package/lib/Source/TMSSource.js +11 -22
- package/lib/Source/VectorTilesSource.js +75 -34
- package/lib/Source/WFSSource.js +7 -14
- package/lib/Source/WMSSource.js +5 -12
- package/lib/Source/WMTSSource.js +3 -10
- package/lib/ThreeExtended/capabilities/WebGL.js +1 -8
- package/lib/ThreeExtended/libs/ktx-parse.module.js +2 -256
- package/lib/ThreeExtended/libs/zstddec.module.js +2 -8
- package/lib/ThreeExtended/loaders/DDSLoader.js +10 -16
- package/lib/ThreeExtended/loaders/DRACOLoader.js +14 -19
- package/lib/ThreeExtended/loaders/GLTFLoader.js +124 -129
- package/lib/ThreeExtended/loaders/KTX2Loader.js +73 -78
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +40 -59
- package/lib/ThreeExtended/utils/WorkerPool.js +2 -9
- package/lib/Utils/CameraUtils.js +32 -44
- package/lib/Utils/DEMUtils.js +8 -19
- package/lib/Utils/FeaturesUtils.js +8 -16
- package/lib/Utils/Gradients.js +3 -12
- package/lib/Utils/OrientationUtils.js +8 -18
- package/lib/Utils/ThreeUtils.js +2 -9
- package/lib/Utils/gui/C3DTilesStyle.js +7 -15
- package/lib/Utils/gui/Main.js +7 -48
- package/lib/Utils/gui/Minimap.js +12 -20
- package/lib/Utils/gui/Navigation.js +6 -14
- package/lib/Utils/gui/Scale.js +11 -19
- package/lib/Utils/gui/Searchbar.js +5 -13
- package/lib/Utils/gui/Widget.js +1 -8
- package/lib/Utils/placeObjectOnGround.js +13 -23
- package/package.json +13 -8
package/lib/Source/TMSSource.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _Source = _interopRequireDefault(require("./Source"));
|
|
9
|
-
var _URLBuilder = _interopRequireDefault(require("../Provider/URLBuilder"));
|
|
10
|
-
var _Extent = _interopRequireWildcard(require("../Core/Geographic/Extent"));
|
|
11
|
-
var _Crs = _interopRequireDefault(require("../Core/Geographic/Crs"));
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
const extent = new _Extent.default(_Crs.default.tms_4326, 0, 0, 0);
|
|
1
|
+
import Source from "./Source.js";
|
|
2
|
+
import URLBuilder from "../Provider/URLBuilder.js";
|
|
3
|
+
import Extent, { globalExtentTMS } from "../Core/Geographic/Extent.js";
|
|
4
|
+
import CRS from "../Core/Geographic/Crs.js";
|
|
5
|
+
const extent = new Extent(CRS.tms_4326, 0, 0, 0);
|
|
15
6
|
|
|
16
7
|
/**
|
|
17
8
|
* @classdesc
|
|
@@ -78,7 +69,7 @@ const extent = new _Extent.default(_Crs.default.tms_4326, 0, 0, 0);
|
|
|
78
69
|
* // Add the layer to the view
|
|
79
70
|
* view.addLayer(imageryLayer);
|
|
80
71
|
*/
|
|
81
|
-
class TMSSource extends
|
|
72
|
+
class TMSSource extends Source {
|
|
82
73
|
/**
|
|
83
74
|
* @param {Object} source - An object that can contain all properties of a
|
|
84
75
|
* TMSSource and {@link Source}. Only `url` is mandatory.
|
|
@@ -94,12 +85,11 @@ class TMSSource extends _Source.default {
|
|
|
94
85
|
this.isTMSSource = true;
|
|
95
86
|
if (!source.extent) {
|
|
96
87
|
// default to the global extent
|
|
97
|
-
this.extent =
|
|
88
|
+
this.extent = globalExtentTMS.get(source.crs);
|
|
98
89
|
}
|
|
99
90
|
this.zoom = source.zoom;
|
|
100
91
|
this.isInverted = source.isInverted || false;
|
|
101
|
-
this.
|
|
102
|
-
this.crs = _Crs.default.formatToTms(source.crs);
|
|
92
|
+
this.crs = CRS.formatToTms(source.crs);
|
|
103
93
|
this.tileMatrixSetLimits = source.tileMatrixSetLimits;
|
|
104
94
|
this.extentSetlimits = {};
|
|
105
95
|
this.tileMatrixCallback = source.tileMatrixCallback || (zoomLevel => zoomLevel);
|
|
@@ -121,7 +111,7 @@ class TMSSource extends _Source.default {
|
|
|
121
111
|
}
|
|
122
112
|
}
|
|
123
113
|
urlFromExtent(extent) {
|
|
124
|
-
return
|
|
114
|
+
return URLBuilder.xyz(extent, this);
|
|
125
115
|
}
|
|
126
116
|
onLayerAdded(options) {
|
|
127
117
|
super.onLayerAdded(options);
|
|
@@ -142,7 +132,7 @@ class TMSSource extends _Source.default {
|
|
|
142
132
|
east,
|
|
143
133
|
south
|
|
144
134
|
} = extent.set(i, tmsl.maxTileRow, tmsl.maxTileCol).as(crs);
|
|
145
|
-
this.extentSetlimits[crs][i] = new
|
|
135
|
+
this.extentSetlimits[crs][i] = new Extent(crs, west, east, south, north);
|
|
146
136
|
}
|
|
147
137
|
}
|
|
148
138
|
}
|
|
@@ -153,5 +143,4 @@ class TMSSource extends _Source.default {
|
|
|
153
143
|
return zoom >= this.zoom.min && zoom <= this.zoom.max && (this.extentSetlimits[extent.crs] == undefined || this.extentSetlimits[extent.crs][zoom].intersectsExtent(extent));
|
|
154
144
|
}
|
|
155
145
|
}
|
|
156
|
-
|
|
157
|
-
exports.default = _default;
|
|
146
|
+
export default TMSSource;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _mapboxGlStyleSpec = require("@mapbox/mapbox-gl-style-spec");
|
|
9
|
-
var _Style = _interopRequireDefault(require("../Core/Style"));
|
|
10
|
-
var _TMSSource = _interopRequireDefault(require("./TMSSource"));
|
|
11
|
-
var _Fetcher = _interopRequireDefault(require("../Provider/Fetcher"));
|
|
12
|
-
var _MapBoxUrlParser = _interopRequireDefault(require("../Parser/MapBoxUrlParser"));
|
|
1
|
+
import { featureFilter } from '@mapbox/mapbox-gl-style-spec';
|
|
2
|
+
import Style from "../Core/Style.js";
|
|
3
|
+
import TMSSource from "./TMSSource.js";
|
|
4
|
+
import URLBuilder from "../Provider/URLBuilder.js";
|
|
5
|
+
import Fetcher from "../Provider/Fetcher.js";
|
|
6
|
+
import urlParser from "../Parser/MapBoxUrlParser.js";
|
|
13
7
|
function toTMSUrl(url) {
|
|
14
8
|
return url.replace(/\{/g, '${');
|
|
15
9
|
}
|
|
10
|
+
function mergeCollections(collections) {
|
|
11
|
+
const collection = collections[0];
|
|
12
|
+
collections.forEach((col, index) => {
|
|
13
|
+
if (index === 0) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
col.features.forEach(feature => {
|
|
17
|
+
collection.features.push(feature);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return collection;
|
|
21
|
+
}
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* @classdesc
|
|
@@ -24,7 +30,7 @@ function toTMSUrl(url) {
|
|
|
24
30
|
* @property {boolean} [symbolToCircle=false] - If true, all symbols from a tile
|
|
25
31
|
* will be considered as circle, and render as circles.
|
|
26
32
|
*/
|
|
27
|
-
class VectorTilesSource extends
|
|
33
|
+
class VectorTilesSource extends TMSSource {
|
|
28
34
|
/**
|
|
29
35
|
* @param {Object} source - An object that can contain all properties of a
|
|
30
36
|
* VectorTilesSource and {@link Source}.
|
|
@@ -59,6 +65,7 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
59
65
|
source.url = source.url || '.';
|
|
60
66
|
super(source);
|
|
61
67
|
const ffilter = source.filter || (() => true);
|
|
68
|
+
this.urls = [];
|
|
62
69
|
this.layers = {};
|
|
63
70
|
this.styles = {};
|
|
64
71
|
let promise;
|
|
@@ -66,8 +73,8 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
66
73
|
this.accessToken = source.accessToken;
|
|
67
74
|
if (source.style) {
|
|
68
75
|
if (typeof source.style == 'string') {
|
|
69
|
-
const styleUrl =
|
|
70
|
-
promise =
|
|
76
|
+
const styleUrl = urlParser.normalizeStyleURL(source.style, this.accessToken);
|
|
77
|
+
promise = Fetcher.json(styleUrl, this.networkOptions);
|
|
71
78
|
} else {
|
|
72
79
|
promise = Promise.resolve(source.style);
|
|
73
80
|
}
|
|
@@ -78,24 +85,22 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
78
85
|
this.jsonStyle = style;
|
|
79
86
|
const baseurl = source.sprite || style.sprite;
|
|
80
87
|
if (baseurl) {
|
|
81
|
-
const spriteUrl =
|
|
82
|
-
return
|
|
88
|
+
const spriteUrl = urlParser.normalizeSpriteURL(baseurl, '', '.json', this.accessToken);
|
|
89
|
+
return Fetcher.json(spriteUrl, this.networkOptions).then(sprites => {
|
|
83
90
|
this.sprites = sprites;
|
|
84
|
-
const imgUrl =
|
|
91
|
+
const imgUrl = urlParser.normalizeSpriteURL(baseurl, '', '.png', this.accessToken);
|
|
85
92
|
this.sprites.source = imgUrl;
|
|
86
93
|
return style;
|
|
87
94
|
});
|
|
88
95
|
}
|
|
89
96
|
return style;
|
|
90
97
|
}).then(style => {
|
|
91
|
-
const s = Object.keys(style.sources)[0];
|
|
92
|
-
const os = style.sources[s];
|
|
93
98
|
style.layers.forEach((layer, order) => {
|
|
94
99
|
layer.sourceUid = this.uid;
|
|
95
100
|
if (layer.type === 'background') {
|
|
96
101
|
this.backgroundLayer = layer;
|
|
97
102
|
} else if (ffilter(layer)) {
|
|
98
|
-
const style =
|
|
103
|
+
const style = Style.setFromVectorTileLayer(layer, this.sprites, order, this.symbolToCircle);
|
|
99
104
|
this.styles[layer.id] = style;
|
|
100
105
|
if (!this.layers[layer['source-layer']]) {
|
|
101
106
|
this.layers[layer['source-layer']] = [];
|
|
@@ -103,7 +108,7 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
103
108
|
this.layers[layer['source-layer']].push({
|
|
104
109
|
id: layer.id,
|
|
105
110
|
order,
|
|
106
|
-
filterExpression:
|
|
111
|
+
filterExpression: featureFilter(layer.filter),
|
|
107
112
|
zoom: {
|
|
108
113
|
min: layer.minzoom || 0,
|
|
109
114
|
max: layer.maxzoom || 24
|
|
@@ -112,17 +117,30 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
112
117
|
}
|
|
113
118
|
});
|
|
114
119
|
if (this.url == '.') {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
const TMSUrlList = Object.values(style.sources).map(sourceVT => {
|
|
121
|
+
if (sourceVT.url) {
|
|
122
|
+
const urlSource = urlParser.normalizeSourceURL(sourceVT.url, this.accessToken);
|
|
123
|
+
return Fetcher.json(urlSource, this.networkOptions).then(tileJSON => {
|
|
124
|
+
if (tileJSON.tiles[0]) {
|
|
125
|
+
return toTMSUrl(tileJSON.tiles[0]);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
} else if (sourceVT.tiles) {
|
|
129
|
+
return Promise.resolve(toTMSUrl(sourceVT.tiles[0]));
|
|
130
|
+
}
|
|
131
|
+
return Promise.reject();
|
|
132
|
+
});
|
|
133
|
+
return Promise.all(TMSUrlList);
|
|
125
134
|
}
|
|
135
|
+
return Promise.resolve([this.url]);
|
|
136
|
+
}).then(TMSUrlList => {
|
|
137
|
+
this.urls = Array.from(new Set(TMSUrlList));
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
urlFromExtent(extent, url) {
|
|
141
|
+
return URLBuilder.xyz(extent, {
|
|
142
|
+
tileMatrixCallback: this.tileMatrixCallback,
|
|
143
|
+
url
|
|
126
144
|
});
|
|
127
145
|
}
|
|
128
146
|
onLayerAdded(options) {
|
|
@@ -134,6 +152,29 @@ class VectorTilesSource extends _TMSSource.default {
|
|
|
134
152
|
}
|
|
135
153
|
}
|
|
136
154
|
}
|
|
155
|
+
loadData(extent, out) {
|
|
156
|
+
const cache = this._featuresCaches[out.crs];
|
|
157
|
+
const key = this.requestToKey(extent);
|
|
158
|
+
// try to get parsed data from cache
|
|
159
|
+
let features = cache.getByArray(key);
|
|
160
|
+
if (!features) {
|
|
161
|
+
// otherwise fetch/parse the data
|
|
162
|
+
features = cache.setByArray(Promise.all(this.urls.map(url => this.fetcher(this.urlFromExtent(extent, url), this.networkOptions).then(file => this.parser(file, {
|
|
163
|
+
out,
|
|
164
|
+
in: this,
|
|
165
|
+
extent
|
|
166
|
+
})))).then(collections => mergeCollections(collections)).catch(err => this.handlingError(err)), key);
|
|
167
|
+
|
|
168
|
+
/* istanbul ignore next */
|
|
169
|
+
if (this.onParsedFile) {
|
|
170
|
+
features.then(feat => {
|
|
171
|
+
this.onParsedFile(feat);
|
|
172
|
+
console.warn('Source.onParsedFile was deprecated');
|
|
173
|
+
return feat;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return features;
|
|
178
|
+
}
|
|
137
179
|
}
|
|
138
|
-
|
|
139
|
-
exports.default = _default;
|
|
180
|
+
export default VectorTilesSource;
|
package/lib/Source/WFSSource.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import Source from "./Source.js";
|
|
2
|
+
import URLBuilder from "../Provider/URLBuilder.js";
|
|
3
|
+
import CRS from "../Core/Geographic/Crs.js";
|
|
2
4
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _Source = _interopRequireDefault(require("./Source"));
|
|
9
|
-
var _URLBuilder = _interopRequireDefault(require("../Provider/URLBuilder"));
|
|
10
|
-
var _Crs = _interopRequireDefault(require("../Core/Geographic/Crs"));
|
|
11
5
|
/**
|
|
12
6
|
* @classdesc
|
|
13
7
|
* An object defining the source of resources to get from a
|
|
@@ -102,7 +96,7 @@ var _Crs = _interopRequireDefault(require("../Core/Geographic/Crs"));
|
|
|
102
96
|
* // Add the layer
|
|
103
97
|
* view.addLayer(geometryLayer);
|
|
104
98
|
*/
|
|
105
|
-
class WFSSource extends
|
|
99
|
+
class WFSSource extends Source {
|
|
106
100
|
/**
|
|
107
101
|
* @param {Object} source - An object that can contain all properties of a
|
|
108
102
|
* WFSSource and {@link Source}. `url`, `typeName` and `crs` are
|
|
@@ -158,18 +152,17 @@ class WFSSource extends _Source.default {
|
|
|
158
152
|
return super.handlingError(err);
|
|
159
153
|
}
|
|
160
154
|
requestToKey(extent) {
|
|
161
|
-
if (
|
|
155
|
+
if (CRS.isTms(extent.crs)) {
|
|
162
156
|
return super.requestToKey(extent);
|
|
163
157
|
} else {
|
|
164
158
|
return [extent.zoom, extent.south, extent.west];
|
|
165
159
|
}
|
|
166
160
|
}
|
|
167
161
|
urlFromExtent(extent) {
|
|
168
|
-
return
|
|
162
|
+
return URLBuilder.bbox(extent, this);
|
|
169
163
|
}
|
|
170
164
|
extentInsideLimit(extent) {
|
|
171
165
|
return this.extent.intersectsExtent(extent);
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
|
-
|
|
175
|
-
exports.default = _default;
|
|
168
|
+
export default WFSSource;
|
package/lib/Source/WMSSource.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import Source from "./Source.js";
|
|
2
|
+
import URLBuilder from "../Provider/URLBuilder.js";
|
|
2
3
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _Source = _interopRequireDefault(require("./Source"));
|
|
9
|
-
var _URLBuilder = _interopRequireDefault(require("../Provider/URLBuilder"));
|
|
10
4
|
/**
|
|
11
5
|
* @classdesc
|
|
12
6
|
* An object defining the source of images to get from a
|
|
@@ -72,7 +66,7 @@ var _URLBuilder = _interopRequireDefault(require("../Provider/URLBuilder"));
|
|
|
72
66
|
* // Add the layer
|
|
73
67
|
* view.addLayer(colorlayer);
|
|
74
68
|
*/
|
|
75
|
-
class WMSSource extends
|
|
69
|
+
class WMSSource extends Source {
|
|
76
70
|
/**
|
|
77
71
|
* @param {Object} source - An object that can contain all properties of
|
|
78
72
|
* WMSSource and {@link Source}. `url`, `name`, `extent` and `crs`
|
|
@@ -130,11 +124,10 @@ class WMSSource extends _Source.default {
|
|
|
130
124
|
}
|
|
131
125
|
}
|
|
132
126
|
urlFromExtent(extent) {
|
|
133
|
-
return
|
|
127
|
+
return URLBuilder.bbox(extent, this);
|
|
134
128
|
}
|
|
135
129
|
extentInsideLimit(extent) {
|
|
136
130
|
return this.extent.intersectsExtent(extent);
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
|
-
|
|
140
|
-
exports.default = _default;
|
|
133
|
+
export default WMSSource;
|
package/lib/Source/WMTSSource.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import TMSSource from "./TMSSource.js";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _TMSSource = _interopRequireDefault(require("./TMSSource"));
|
|
9
3
|
/**
|
|
10
4
|
* @classdesc
|
|
11
5
|
* An object defining the source of resources to get from a
|
|
@@ -65,7 +59,7 @@ var _TMSSource = _interopRequireDefault(require("./TMSSource"));
|
|
|
65
59
|
* // Add the layer
|
|
66
60
|
* view.addLayer(colorLayer);
|
|
67
61
|
*/
|
|
68
|
-
class WMTSSource extends
|
|
62
|
+
class WMTSSource extends TMSSource {
|
|
69
63
|
/**
|
|
70
64
|
* @param {Object} source - An object that can contain all properties of a
|
|
71
65
|
* WMTSSource and {@link Source}. Only `url`, `name` and `crs` are mandatory.
|
|
@@ -92,5 +86,4 @@ class WMTSSource extends _TMSSource.default {
|
|
|
92
86
|
}
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
|
-
|
|
96
|
-
exports.default = _default;
|
|
89
|
+
export default WMTSSource;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
class WebGL {
|
|
8
2
|
static isWebGLAvailable() {
|
|
9
3
|
try {
|
|
@@ -67,5 +61,4 @@ class WebGL {
|
|
|
67
61
|
return element;
|
|
68
62
|
}
|
|
69
63
|
}
|
|
70
|
-
|
|
71
|
-
exports.default = _default;
|
|
64
|
+
export default WebGL;
|