itowns 2.36.1 → 2.36.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/changelog.md +22 -0
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/examples/js/plugins/CSVnVRTParser.js +0 -1
- package/examples/layers/JSONLayers/Administrative.json +1 -1
- package/examples/layers/JSONLayers/Cada.json +1 -1
- package/examples/layers/JSONLayers/EtatMajor.json +1 -1
- package/examples/layers/JSONLayers/IGN_MNT.json +1 -1
- package/examples/layers/JSONLayers/IGN_MNT_HIGHRES.json +1 -1
- package/examples/layers/JSONLayers/WORLD_DTM.json +1 -1
- package/examples/misc_custom_label.html +0 -2
- package/examples/plugins_vrt.html +0 -1
- package/examples/source_file_geojson_raster.html +0 -3
- package/examples/source_file_shapefile.html +0 -1
- package/lib/Core/Feature.js +11 -7
- package/lib/Core/Geographic/Coordinates.js +7 -7
- package/lib/Core/Geographic/Extent.js +14 -14
- package/lib/Main.js +1 -1
- package/lib/Parser/ShapefileParser.js +0 -1
- package/lib/Source/FileSource.js +2 -7
- package/lib/Source/VectorTilesSource.js +7 -4
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"transparent": true,
|
|
7
7
|
"source": {
|
|
8
8
|
"crs": "EPSG:3857",
|
|
9
|
-
"url": "https://wxs.ign.fr/
|
|
9
|
+
"url": "https://wxs.ign.fr/administratif/geoportail/wmts",
|
|
10
10
|
"format": "image/png",
|
|
11
11
|
"name": "LIMITES_ADMINISTRATIVES_EXPRESS.LATEST",
|
|
12
12
|
"style": "normal",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"source": {
|
|
12
12
|
"format": "image/x-bil;bits=32",
|
|
13
13
|
"crs": "EPSG:4326",
|
|
14
|
-
"url": "https://wxs.ign.fr/
|
|
14
|
+
"url": "https://wxs.ign.fr/altimetrie/geoportail/wmts",
|
|
15
15
|
"name": "ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3",
|
|
16
16
|
"tileMatrixSet": "WGS84G",
|
|
17
17
|
"tileMatrixSetLimits": {
|
|
@@ -109,9 +109,6 @@
|
|
|
109
109
|
// Here, we pass a FeatureBuildingOptions (http://www.itowns-project.org/itowns/docs/#api/Base/FeatureBuildingOptions)
|
|
110
110
|
out: {
|
|
111
111
|
crs: view.tileLayer.extent.crs,
|
|
112
|
-
buildExtent: true,
|
|
113
|
-
mergeFeatures: true,
|
|
114
|
-
structure: '2d',
|
|
115
112
|
},
|
|
116
113
|
});
|
|
117
114
|
}).then(function _(features) {
|
package/lib/Core/Feature.js
CHANGED
|
@@ -81,17 +81,18 @@ exports.FEATURE_TYPES = FEATURE_TYPES;
|
|
|
81
81
|
var typeToStyleProperty = ['point', 'stroke', 'fill'];
|
|
82
82
|
/**
|
|
83
83
|
* @property {string} crs - The CRS to convert the input coordinates to.
|
|
84
|
+
* @property {string} [structure='2d'] - data structure type : 2d or 3d.
|
|
85
|
+
* If the structure is 3d, the feature have 3 dimensions by vertices positions and
|
|
86
|
+
* a normal for each vertices.
|
|
84
87
|
* @property {Extent|boolean} [filteringExtent=undefined] - Optional filter to reject
|
|
85
|
-
* features outside of extent. Extent
|
|
86
|
-
* @property {boolean} [buildExtent
|
|
88
|
+
* features outside of extent. Extent filtering is file extent if filteringExtent is true.
|
|
89
|
+
* @property {boolean} [buildExtent] - If true the geometry will
|
|
87
90
|
* have an extent property containing the area covered by the geometry.
|
|
91
|
+
* Default value is false if `structure` parameter is set to '3d', and true otherwise.
|
|
88
92
|
* True if the layer does not inherit from {@link GeometryLayer}.
|
|
89
93
|
* @property {string} forcedExtentCrs - force feature extent crs if buildExtent is true.
|
|
90
94
|
* @property {function} [filter] - Filter function to remove features
|
|
91
|
-
* @property {boolean} [mergeFeatures=true] - If true all geometries are merged by type and multi-type
|
|
92
|
-
* @property {string} [structure='2d'] - data structure type : 2d or 3d.
|
|
93
|
-
* If the structure is 3d, the feature have 3 dimensions by vertices positions and
|
|
94
|
-
* a normal for each vertices.
|
|
95
|
+
* @property {boolean} [mergeFeatures=true] - If true all geometries are merged by type and multi-type.
|
|
95
96
|
* @property {Style} style - The style to inherit when creating
|
|
96
97
|
* style for all new features.
|
|
97
98
|
*
|
|
@@ -464,7 +465,6 @@ var FeatureCollection = /*#__PURE__*/function (_THREE$Object3D) {
|
|
|
464
465
|
_this.crs = _Crs["default"].formatToEPSG(options.crs);
|
|
465
466
|
_this.features = [];
|
|
466
467
|
_this.mergeFeatures = options.mergeFeatures === undefined ? true : options.mergeFeatures;
|
|
467
|
-
_this.extent = options.buildExtent ? defaultExtent(options.forcedExtentCrs || _this.crs) : undefined;
|
|
468
468
|
_this.size = options.structure == '3d' ? 3 : 2;
|
|
469
469
|
_this.filterExtent = options.filterExtent;
|
|
470
470
|
_this.style = options.style;
|
|
@@ -473,6 +473,8 @@ var FeatureCollection = /*#__PURE__*/function (_THREE$Object3D) {
|
|
|
473
473
|
_this.center = new _Coordinates["default"]('EPSG:4326', 0, 0);
|
|
474
474
|
|
|
475
475
|
if (_this.size == 2) {
|
|
476
|
+
_this.extent = options.buildExtent === false ? undefined : defaultExtent(options.forcedExtentCrs || _this.crs);
|
|
477
|
+
|
|
476
478
|
_this._setLocalSystem = function (center) {
|
|
477
479
|
// set local system center
|
|
478
480
|
center.as('EPSG:4326', _this.center); // set position to local system center
|
|
@@ -486,6 +488,8 @@ var FeatureCollection = /*#__PURE__*/function (_THREE$Object3D) {
|
|
|
486
488
|
|
|
487
489
|
_this._transformToLocalSystem = transformToLocalSystem2D;
|
|
488
490
|
} else {
|
|
491
|
+
_this.extent = options.buildExtent ? defaultExtent(options.forcedExtentCrs || _this.crs) : undefined;
|
|
492
|
+
|
|
489
493
|
_this._setLocalSystem = function (center) {
|
|
490
494
|
// set local system center
|
|
491
495
|
center.as('EPSG:4326', _this.center);
|
|
@@ -263,20 +263,20 @@ var Coordinates = /*#__PURE__*/function () {
|
|
|
263
263
|
return v0.distanceTo(v1);
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
* Calculate
|
|
267
|
-
* **
|
|
266
|
+
* Calculate geodetic distance between this coordinates and `coord`.
|
|
267
|
+
* **Geodetic distance** is calculated in an ellispoid space as the shortest distance
|
|
268
268
|
* across the curved surface of the world.
|
|
269
269
|
*
|
|
270
270
|
* => As the crow flies/ Orthodromy
|
|
271
271
|
*
|
|
272
272
|
* @param {Coordinates} coord The coordinate
|
|
273
|
-
* @return {number}
|
|
273
|
+
* @return {number} geodetic distance
|
|
274
274
|
*
|
|
275
275
|
*/
|
|
276
276
|
|
|
277
277
|
}, {
|
|
278
|
-
key: "
|
|
279
|
-
value: function
|
|
278
|
+
key: "geodeticDistanceTo",
|
|
279
|
+
value: function geodeticDistanceTo(coord) {
|
|
280
280
|
this.as('EPSG:4326', coord0);
|
|
281
281
|
coord.as('EPSG:4326', coord1);
|
|
282
282
|
return ellipsoid.geodesicDistance(coord0, coord1);
|
|
@@ -290,8 +290,8 @@ var Coordinates = /*#__PURE__*/function () {
|
|
|
290
290
|
*/
|
|
291
291
|
|
|
292
292
|
}, {
|
|
293
|
-
key: "
|
|
294
|
-
value: function
|
|
293
|
+
key: "spatialEuclideanDistanceTo",
|
|
294
|
+
value: function spatialEuclideanDistanceTo(coord) {
|
|
295
295
|
this.as('EPSG:4978', coord0).toVector3(v0);
|
|
296
296
|
coord.as('EPSG:4978', coord1).toVector3(v1);
|
|
297
297
|
return v0.distanceTo(v1);
|
|
@@ -326,7 +326,7 @@ var Extent = /*#__PURE__*/function () {
|
|
|
326
326
|
key: "dimensions",
|
|
327
327
|
value: function dimensions() {
|
|
328
328
|
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new THREE.Vector2();
|
|
329
|
-
console.warn('Extent.dimensions is deprecated, use planarDimensions,
|
|
329
|
+
console.warn('Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions');
|
|
330
330
|
target.x = Math.abs(this.east - this.west);
|
|
331
331
|
target.y = Math.abs(this.north - this.south);
|
|
332
332
|
return target;
|
|
@@ -347,17 +347,17 @@ var Extent = /*#__PURE__*/function () {
|
|
|
347
347
|
return target.set(Math.abs(this.east - this.west), Math.abs(this.north - this.south));
|
|
348
348
|
}
|
|
349
349
|
/**
|
|
350
|
-
*
|
|
351
|
-
*
|
|
350
|
+
* Geodetic dimensions are two planar distances west/east and south/north.
|
|
351
|
+
* Geodetic distance is calculated in an ellispoid space as the distance
|
|
352
352
|
* across the curved surface of the world.
|
|
353
353
|
*
|
|
354
354
|
* @param {THREE.Vector2} [target=new THREE.Vector2()] The target
|
|
355
|
-
* @return {THREE.Vector2}
|
|
355
|
+
* @return {THREE.Vector2} geodetic dimensions
|
|
356
356
|
*/
|
|
357
357
|
|
|
358
358
|
}, {
|
|
359
|
-
key: "
|
|
360
|
-
value: function
|
|
359
|
+
key: "geodeticDimensions",
|
|
360
|
+
value: function geodeticDimensions() {
|
|
361
361
|
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new THREE.Vector2();
|
|
362
362
|
// set 3 corners extent
|
|
363
363
|
cNorthWest.crs = this.crs;
|
|
@@ -365,21 +365,21 @@ var Extent = /*#__PURE__*/function () {
|
|
|
365
365
|
cNorthEast.crs = this.crs;
|
|
366
366
|
cNorthWest.setFromValues(this.west, this.north, 0);
|
|
367
367
|
cSouthWest.setFromValues(this.west, this.south, 0);
|
|
368
|
-
cNorthEast.setFromValues(this.east, this.north, 0); // calcul
|
|
368
|
+
cNorthEast.setFromValues(this.east, this.north, 0); // calcul geodetic distance northWest/northEast and northWest/southWest
|
|
369
369
|
|
|
370
|
-
return target.set(cNorthWest.
|
|
370
|
+
return target.set(cNorthWest.geodeticDistanceTo(cNorthEast), cNorthWest.geodeticDistanceTo(cSouthWest));
|
|
371
371
|
}
|
|
372
372
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
373
|
+
* Spatial euclidean dimensions are two spatial euclidean distances between west/east corner and south/north corner.
|
|
374
|
+
* Spatial euclidean distance chord is calculated in a ellispoid space.
|
|
375
375
|
*
|
|
376
376
|
* @param {THREE.Vector2} [target=new THREE.Vector2()] The target
|
|
377
|
-
* @return {THREE.Vector2}
|
|
377
|
+
* @return {THREE.Vector2} spatial euclidean dimensions
|
|
378
378
|
*/
|
|
379
379
|
|
|
380
380
|
}, {
|
|
381
|
-
key: "
|
|
382
|
-
value: function
|
|
381
|
+
key: "spatialEuclideanDimensions",
|
|
382
|
+
value: function spatialEuclideanDimensions() {
|
|
383
383
|
var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new THREE.Vector2();
|
|
384
384
|
// set 3 corners extent
|
|
385
385
|
cNorthWest.crs = this.crs;
|
|
@@ -389,7 +389,7 @@ var Extent = /*#__PURE__*/function () {
|
|
|
389
389
|
cSouthWest.setFromValues(this.west, this.south, 0);
|
|
390
390
|
cNorthEast.setFromValues(this.east, this.north, 0); // calcul chord distance northWest/northEast and northWest/southWest
|
|
391
391
|
|
|
392
|
-
return target.set(cNorthWest.
|
|
392
|
+
return target.set(cNorthWest.spatialEuclideanDistanceTo(cNorthEast), cNorthWest.spatialEuclideanDistanceTo(cSouthWest));
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
395
395
|
* Return true if `coord` is inside the bounding box.
|
package/lib/Main.js
CHANGED
|
@@ -690,7 +690,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
690
690
|
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; }
|
|
691
691
|
|
|
692
692
|
var conf = {
|
|
693
|
-
version: '2.36.
|
|
693
|
+
version: '2.36.2'
|
|
694
694
|
};
|
|
695
695
|
var REVISION = conf.version; // Geographic tools
|
|
696
696
|
|
package/lib/Source/FileSource.js
CHANGED
|
@@ -106,13 +106,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
106
106
|
* itowns.Fetcher.json('https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements/09-ariege/departement-09-ariege.geojson')
|
|
107
107
|
* .then(function _(geojson) {
|
|
108
108
|
* return itowns.GeoJsonParser.parse(geojson, {
|
|
109
|
-
* in: {
|
|
110
|
-
* out: {
|
|
111
|
-
* crs: view.tileLayer.extent.crs,
|
|
112
|
-
* buildExtent: true,
|
|
113
|
-
* mergeFeatures: true,
|
|
114
|
-
* structure: '2d',
|
|
115
|
-
* },
|
|
109
|
+
* in: { crs: 'EPSG:4326' },
|
|
110
|
+
* out: { crs: view.tileLayer.extent.crs },
|
|
116
111
|
* });
|
|
117
112
|
* }).then(function _(features) {
|
|
118
113
|
* ariege.source = new itowns.FileSource({
|
|
@@ -182,10 +182,13 @@ var VectorTilesSource = /*#__PURE__*/function (_TMSSource) {
|
|
|
182
182
|
var _this2 = this;
|
|
183
183
|
|
|
184
184
|
(0, _get2["default"])((0, _getPrototypeOf2["default"])(VectorTilesSource.prototype), "onLayerAdded", this).call(this, options);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
|
|
186
|
+
if (options.out.style) {
|
|
187
|
+
var keys = Object.keys(this.styles);
|
|
188
|
+
keys.forEach(function (k) {
|
|
189
|
+
_this2.styles[k].parent = options.out.style;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
193
|
}]);
|
|
191
194
|
return VectorTilesSource;
|