itowns 2.37.0 → 2.38.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.
Files changed (77) hide show
  1. package/README.md +12 -1
  2. package/changelog.md +101 -0
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +2 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +2 -2
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_widgets.js +1 -1
  10. package/dist/itowns_widgets.js.map +1 -1
  11. package/examples/config.json +4 -1
  12. package/examples/css/example.css +21 -1
  13. package/examples/css/widgets.css +118 -6
  14. package/examples/images/code-logo.svg +43 -0
  15. package/examples/index.html +5 -5
  16. package/examples/mars.html +0 -1
  17. package/examples/misc_orthographic_camera.html +7 -19
  18. package/examples/vector_tile_3d_mesh.html +155 -0
  19. package/examples/vector_tile_raster_3d.html +0 -5
  20. package/examples/view_25d_map.html +6 -19
  21. package/examples/view_2d_map.html +6 -19
  22. package/examples/view_3d_map.html +106 -81
  23. package/examples/widgets_minimap.html +3 -1
  24. package/examples/widgets_navigation.html +6 -1
  25. package/examples/widgets_scale.html +96 -0
  26. package/examples/widgets_searchbar.html +124 -0
  27. package/lib/Controls/PlanarControls.js +10 -42
  28. package/lib/Converter/Feature2Mesh.js +225 -61
  29. package/lib/Converter/Feature2Texture.js +4 -3
  30. package/lib/Converter/convertToTile.js +10 -5
  31. package/lib/Core/Feature.js +57 -30
  32. package/lib/Core/MainLoop.js +136 -62
  33. package/lib/Core/TileMesh.js +21 -5
  34. package/lib/Core/View.js +46 -15
  35. package/lib/Layer/FeatureGeometryLayer.js +37 -10
  36. package/lib/Layer/GeoidLayer.js +17 -6
  37. package/lib/Layer/GeometryLayer.js +6 -54
  38. package/lib/Layer/OrientedImageLayer.js +1 -0
  39. package/lib/Layer/RasterLayer.js +3 -1
  40. package/lib/Layer/ReferencingLayerProperties.js +50 -0
  41. package/lib/Main.js +1 -1
  42. package/lib/Parser/B3dmParser.js +3 -2
  43. package/lib/Parser/GeoJsonParser.js +29 -7
  44. package/lib/Parser/VectorTileParser.js +5 -4
  45. package/lib/Parser/deprecated/LegacyGLTFLoader.js +3 -3
  46. package/lib/Process/3dTilesProcessing.js +3 -3
  47. package/lib/Process/FeatureProcessing.js +36 -86
  48. package/lib/Process/LayeredMaterialNodeProcessing.js +9 -3
  49. package/lib/Process/ObjectRemovalHelper.js +4 -0
  50. package/lib/Provider/3dTilesProvider.js +2 -7
  51. package/lib/Provider/Fetcher.js +5 -2
  52. package/lib/Provider/TileProvider.js +18 -2
  53. package/lib/Renderer/Camera.js +33 -12
  54. package/lib/Renderer/ColorLayersOrdering.js +3 -1
  55. package/lib/Renderer/LayeredMaterial.js +32 -7
  56. package/lib/Renderer/OBB.js +8 -4
  57. package/lib/Renderer/OrientedImageMaterial.js +8 -5
  58. package/lib/Renderer/PointsMaterial.js +1 -0
  59. package/lib/Renderer/RenderMode.js +3 -1
  60. package/lib/Renderer/Shader/ShaderChunk.js +5 -1
  61. package/lib/Renderer/c3DEngine.js +9 -6
  62. package/lib/Source/FileSource.js +8 -1
  63. package/lib/Source/VectorTilesSource.js +5 -0
  64. package/lib/Source/WFSSource.js +9 -3
  65. package/lib/ThreeExtended/{WebGL.js → capabilities/WebGL.js} +8 -7
  66. package/lib/ThreeExtended/loaders/GLTFLoader.js +3 -4
  67. package/lib/Utils/DEMUtils.js +3 -1
  68. package/lib/Utils/gui/Main.js +39 -0
  69. package/lib/Utils/gui/Minimap.js +195 -0
  70. package/lib/Utils/gui/Navigation.js +322 -0
  71. package/lib/Utils/gui/Scale.js +154 -0
  72. package/lib/Utils/gui/Searchbar.js +299 -0
  73. package/lib/Utils/gui/Widget.js +119 -0
  74. package/package.json +27 -22
  75. package/examples/images/compass.svg +0 -60
  76. package/examples/images/widget-logo.svg +0 -66
  77. package/examples/js/Scale.js +0 -41
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));
23
+
24
+ var _classPrivateFieldSet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldSet"));
25
+
26
+ var _Fetcher = _interopRequireDefault(require("../../Provider/Fetcher"));
27
+
28
+ var _Widget2 = _interopRequireDefault(require("./Widget"));
29
+
30
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
31
+
32
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
33
+
34
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
35
+
36
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
37
+
38
+ var DEFAULT_OPTIONS = {
39
+ width: 300,
40
+ height: 38,
41
+ position: 'top',
42
+ maxSuggestionNumber: 10,
43
+ fontSize: 16,
44
+ placeholder: 'Search location'
45
+ };
46
+
47
+ function addActive(htmlElements, index) {
48
+ var _htmlElements$index;
49
+
50
+ if (!htmlElements) {
51
+ return index;
52
+ }
53
+
54
+ removeAllActives(htmlElements);
55
+
56
+ if (index >= htmlElements.length) {
57
+ index = 0;
58
+ } else if (index < 0) {
59
+ index = htmlElements.length - 1;
60
+ }
61
+
62
+ (_htmlElements$index = htmlElements[index]) === null || _htmlElements$index === void 0 ? void 0 : _htmlElements$index.classList.add('active');
63
+ return index;
64
+ }
65
+
66
+ function removeAllActives(htmlElements) {
67
+ for (var i = 0; i < htmlElements.length; i++) {
68
+ htmlElements[i].classList.remove('active');
69
+ }
70
+ }
71
+
72
+ function eraseSuggestionList(form) {
73
+ while (form.children.length > 1) {
74
+ form.removeChild(form.lastChild);
75
+ }
76
+ }
77
+ /**
78
+ * A widget for searchbar
79
+ *
80
+ * To use it, you need to link the widgets' stylesheet to your html webpage. This stylesheet is included in
81
+ * [itowns bundles](https://github.com/iTowns/itowns/releases) if you downloaded them, or it can be found in
82
+ * `node_modules/itowns/examples/css` if you installed iTowns with npm. Otherwise, it can be found at
83
+ * [this link](https://raw.githubusercontent.com/iTowns/itowns/master/examples/css/widgets.css). See
84
+ * [this example](http://www.itowns-project.org/itowns/examples/#widgets_searchbar) for more details.
85
+ *
86
+ * @extends Widget
87
+ *
88
+ * @property {HTMLElement} domElement An html div containing the searchbar.
89
+ * @property {HTMLElement} parentElement The parent HTML container of `this.domElement`.
90
+ */
91
+
92
+
93
+ var _onSelected = /*#__PURE__*/new WeakMap();
94
+
95
+ var Searchbar = /*#__PURE__*/function (_Widget) {
96
+ (0, _inherits2["default"])(Searchbar, _Widget);
97
+
98
+ var _super = _createSuper(Searchbar);
99
+
100
+ /**
101
+ * @param {View} view The iTowns view the searchbar should be linked
102
+ * to.
103
+ *
104
+ * @param {Object} geocodingOptions Configuration for geocoding.
105
+ * @param {URL} geocodingOptions.url The URL of a geocoding service that should be
106
+ * used to build suggestions.
107
+ * @param {function} geocodingOptions.parser A method to parse fetched results from geocoding
108
+ * url into a Map object. For each entry of this
109
+ * Map, the key must be a string that will be
110
+ * displayed as the html content of each
111
+ * suggestion bellow the searchbar. The value
112
+ * associated to the key is whatever the user
113
+ * wants. The value is the parameter that is
114
+ * passed to the `onSelected` method (specified
115
+ * in another `geocodingOptions` parameter).
116
+ * @param {function} [geocodingOptions.onSelected] A method which describes what should be done
117
+ * when user selects a location (by clicking or
118
+ * hitting enter on a suggestion). The only
119
+ * parameter of this method is the value mapped
120
+ * with `geocodingOptions.parser` method.
121
+ *
122
+ * @param {Object} [options] The searchbar optional configuration.
123
+ * @param {HTMLElement} [options.parentElement=view.domElement] The parent HTML container of the div which
124
+ * contains searchbar widgets.
125
+ * @param {number} [options.size] The size of the searchbar. It is a number that
126
+ * describes both width and height in pixels of
127
+ * the searchbar.
128
+ * @param {number} [options.width=300] The width in pixels of the searchbar.
129
+ * @param {number} [options.height=38] The height in pixels of the searchbar.
130
+ * @param {string} [options.position='top'] Defines which position within the
131
+ * `parentElement` the searchbar should be
132
+ * displayed to. Possible values are `top`,
133
+ * `bottom`, `left`, `right`, `top-left`,
134
+ * `top-right`, `bottom-left` and `bottom-right`.
135
+ * If the input value does not match one of
136
+ * these, it will be defaulted to `top`.
137
+ * @param {Object} [options.translate] An optional translation of the searchbar.
138
+ * @param {number} [options.translate.x=0] The searchbar translation along the page x-axis.
139
+ * @param {number} [options.translate.y=0] The searchbar translation along the page y-axis.
140
+ * @param {number} [options.fontSize=16] The font size in pixel of the searchbar content.
141
+ * @param {number} [options.maxSuggestionNumber=10] The maximum number of suggestions that should
142
+ * appear under the searchbar.
143
+ * @param {string} [options.placeholder='Search location'] The placeholder that appears in the searchbar
144
+ * when nothing has yet been typed.
145
+ */
146
+ function Searchbar(view, geocodingOptions) {
147
+ var _geocodingOptions$onS;
148
+
149
+ var _this;
150
+
151
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
152
+ (0, _classCallCheck2["default"])(this, Searchbar);
153
+ // ---------- BUILD PROPERTIES ACCORDING TO DEFAULT OPTIONS AND OPTIONS PASSED IN PARAMETERS : ----------
154
+ _this = _super.call(this, view, options, DEFAULT_OPTIONS); // Check if `geocodingOptions` parameter was correctly specified.
155
+
156
+ _classPrivateFieldInitSpec((0, _assertThisInitialized2["default"])(_this), _onSelected, {
157
+ writable: true,
158
+ value: void 0
159
+ });
160
+
161
+ if (!geocodingOptions || !geocodingOptions.url || !geocodingOptions.parser || typeof geocodingOptions.parser !== 'function') {
162
+ throw new Error('\'geocodingOptions\' parameter for \'Searchbar\' constructor is not a valid option. Please refer to ' + 'the documentation.');
163
+ }
164
+
165
+ (0, _classPrivateFieldSet2["default"])((0, _assertThisInitialized2["default"])(_this), _onSelected, (_geocodingOptions$onS = geocodingOptions.onSelected) !== null && _geocodingOptions$onS !== void 0 ? _geocodingOptions$onS : function () {}); // ---------- this.domElement SETTINGS SPECIFIC TO SEARCHBAR : ----------
166
+
167
+ _this.domElement.id = 'widgets-searchbar';
168
+ _this.domElement.style.height = 'auto';
169
+ var form = document.createElement('form');
170
+ form.setAttribute('autocomplete', 'off');
171
+ form.id = 'searchbar-autocompletion-form';
172
+
173
+ _this.domElement.appendChild(form);
174
+
175
+ var input = document.createElement('input');
176
+ input.setAttribute('type', 'text');
177
+ input.setAttribute('name', 'mySearch');
178
+ input.setAttribute('placeholder', options.placeholder || DEFAULT_OPTIONS.placeholder);
179
+ input.style.height = "".concat(options.height || options.size || DEFAULT_OPTIONS.height, "px");
180
+ input.style.fontSize = "".concat(options.fontSize || DEFAULT_OPTIONS.fontSize, "px");
181
+ form.appendChild(input); // currentFocus variable stores the index of the suggestions that is focused by user, either with mouse or arrow
182
+ // keys.
183
+
184
+ var currentFocus; // ---------- BUILD AUTOCOMPLETION SUGGESTIONS LIST WHEN TYPING THE SEARCHBAR INPUT : ----------
185
+
186
+ input.addEventListener('input', function () {
187
+ var value = input.value; // Close any already opened list of autocompleted values
188
+
189
+ eraseSuggestionList(form);
190
+ currentFocus = -1;
191
+
192
+ if (!value) {
193
+ return false;
194
+ }
195
+
196
+ geocodingOptions.url.searchParams.set('text', value);
197
+
198
+ _Fetcher["default"].json(geocodingOptions.url).then(function (geocodingResult) {
199
+ var result = geocodingOptions.parser(geocodingResult);
200
+ var i = 0;
201
+ result.forEach(function (info, location) {
202
+ // Stop looping through the map if enough location have been proceeded.
203
+ if (i === Math.min(result.size, options.maxSuggestionNumber || DEFAULT_OPTIONS.maxSuggestionNumber)) {
204
+ return;
205
+ }
206
+
207
+ var mapIndex = i;
208
+ i++;
209
+ var index = location.toUpperCase().indexOf(value.toUpperCase());
210
+
211
+ if (index > -1) {
212
+ var autocompleteItem = document.createElement('div');
213
+ autocompleteItem.style.minHeight = input.style.height;
214
+ autocompleteItem.style.fontSize = "".concat(options.fontSize || DEFAULT_OPTIONS.fontSize, "px"); // Make the matching letters bold.
215
+
216
+ var start = location.slice(0, index);
217
+ var bold = location.slice(index, index + value.length);
218
+ var end = location.slice(index + value.length, location.length);
219
+ autocompleteItem.innerHTML = "<p>".concat(start, "<strong>").concat(bold, "</strong>").concat(end, "</p>"); // Store the current location value as an attribute of autocompleteItem div.
220
+
221
+ autocompleteItem.setAttribute('location', location);
222
+ form.appendChild(autocompleteItem); // eslint-disable-next-line no-loop-func
223
+
224
+ autocompleteItem.addEventListener('mouseover', function () {
225
+ removeAllActives(form.children);
226
+ currentFocus = mapIndex;
227
+ autocompleteItem.classList.add('active');
228
+ });
229
+ autocompleteItem.addEventListener('click', function () {
230
+ (0, _classPrivateFieldGet2["default"])((0, _assertThisInitialized2["default"])(_this), _onSelected).call((0, _assertThisInitialized2["default"])(_this), info);
231
+ input.value = autocompleteItem.getAttribute('location');
232
+ eraseSuggestionList(form);
233
+ });
234
+ }
235
+ });
236
+ });
237
+ }); // ---------- MANAGE KEYBOARD INTERACTIONS ON AUTOCOMPLETION SUGGESTIONS : ----------
238
+ // When searchbar is positioned at the bottom of the screen (therefore is a flex with `column-reverse`
239
+ // direction, we must exchange up and down arrow actions.
240
+
241
+ var topOrBottom = (options.position || DEFAULT_OPTIONS.position).includes('top') ? 1 : -1;
242
+ input.addEventListener('keydown', function (event) {
243
+ event.stopPropagation();
244
+ var completionSuggestions = form.getElementsByTagName('div');
245
+
246
+ switch (event.code) {
247
+ case 'Escape':
248
+ eraseSuggestionList(form);
249
+ input.value = '';
250
+ view.domElement.focus();
251
+ break;
252
+
253
+ case 'ArrowDown':
254
+ event.preventDefault();
255
+ currentFocus = addActive(completionSuggestions, currentFocus + topOrBottom);
256
+ break;
257
+
258
+ case 'ArrowUp':
259
+ event.preventDefault();
260
+ currentFocus = addActive(completionSuggestions, currentFocus - topOrBottom);
261
+ break;
262
+
263
+ case 'Enter':
264
+ event.preventDefault();
265
+
266
+ if (completionSuggestions[Math.max(currentFocus, 0)]) {
267
+ completionSuggestions[Math.max(currentFocus, 0)].click();
268
+ view.domElement.focus();
269
+ }
270
+
271
+ break;
272
+
273
+ default:
274
+ break;
275
+ }
276
+ }); // ---------- MANAGE FOCUS AND ACTIVE SUGGESTION WHEN USER ENTERS OR LEAVES THE SEARCHBAR : ----------
277
+ // User clicks the searchbar.
278
+
279
+ input.addEventListener('focus', function () {
280
+ form.classList.add('focus');
281
+ }); // User clicks out of the searchbar.
282
+
283
+ input.addEventListener('blur', function () {
284
+ form.classList.remove('focus');
285
+ removeAllActives(form.children);
286
+ }); // Cursor leaves the searchbar.
287
+
288
+ form.addEventListener('mouseleave', function () {
289
+ removeAllActives(form.children);
290
+ currentFocus = -1;
291
+ });
292
+ return _this;
293
+ }
294
+
295
+ return (0, _createClass2["default"])(Searchbar);
296
+ }(_Widget2["default"]);
297
+
298
+ var _default = Searchbar;
299
+ exports["default"] = _default;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
+
14
+ var _classPrivateFieldSet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldSet"));
15
+
16
+ var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));
17
+
18
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
19
+
20
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
21
+
22
+ var _display = /*#__PURE__*/new WeakMap();
23
+
24
+ /**
25
+ * An interface that stores common methods for all specific widgets.
26
+ *
27
+ * @hideconstructor
28
+ */
29
+ var Widget = /*#__PURE__*/function () {
30
+ function Widget(view) {
31
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
32
+ var defaultOptions = arguments.length > 2 ? arguments[2] : undefined;
33
+ (0, _classCallCheck2["default"])(this, Widget);
34
+
35
+ _classPrivateFieldInitSpec(this, _display, {
36
+ writable: true,
37
+ value: void 0
38
+ });
39
+
40
+ this.parentElement = options.parentElement || view.domElement;
41
+ this.position = options.position || defaultOptions.position;
42
+
43
+ if (!['top-left', 'top-right', 'bottom-left', 'bottom-right', 'top', 'bottom', 'left', 'right'].includes(this.position)) {
44
+ console.warn('\'position\' optional parameter for \'Widget\' constructor is not a valid option. ' + "It will be set to '".concat(defaultOptions.position, "'."));
45
+ this.position = defaultOptions.position;
46
+ } // ---------- CREATE A DomElement WITH id, classes AND style RELEVANT TO THE WIDGET PROPERTIES : ----------
47
+ // Create a div containing minimap widget and add it to its specified parent.
48
+
49
+
50
+ this.domElement = document.createElement('div');
51
+ this.parentElement.appendChild(this.domElement); // Size widget according to options.
52
+
53
+ this.domElement.style.width = "".concat(options.width || options.size || defaultOptions.width, "px");
54
+ this.domElement.style.height = "".concat(options.height || options.size || defaultOptions.height, "px"); // Position widget according to options.
55
+
56
+ var positionArray = this.position.split('-');
57
+ this.domElement.classList.add("".concat(positionArray[0], "-widget"));
58
+
59
+ if (positionArray[1]) {
60
+ this.domElement.classList.add("".concat(positionArray[1], "-widget"));
61
+ } else {
62
+ // If only one position parameter was given, center the domElement on the other axis.
63
+ // TODO : at this stage, offsetWidth and offsetHeight do no include borders. This should be worked around.
64
+ switch (positionArray[0]) {
65
+ case 'top':
66
+ case 'bottom':
67
+ this.domElement.style.left = "calc(50% - ".concat(this.domElement.offsetWidth / 2, "px)");
68
+ break;
69
+
70
+ case 'left':
71
+ case 'right':
72
+ this.domElement.style.top = "calc(50% - ".concat(this.domElement.offsetHeight / 2, "px)");
73
+ break;
74
+
75
+ default:
76
+ break;
77
+ }
78
+ } // Translate widget div according to optional translate parameter.
79
+
80
+
81
+ if (options.translate) {
82
+ this.domElement.style.transform = "translate(".concat(options.translate.x || 0, "px, ").concat(options.translate.y || 0, "px)");
83
+ } // Prevent triggering `GlobeControls` and `PlanarControls` mouse or pointer events when clicking the search bar.
84
+ // For example, this prevents triggering an animated travel when double-clicking search bar in a `GlobeView`.
85
+
86
+
87
+ this.domElement.addEventListener('pointerdown', function (e) {
88
+ e.stopPropagation();
89
+ });
90
+ this.domElement.addEventListener('mousedown', function (e) {
91
+ e.stopPropagation();
92
+ });
93
+ }
94
+ /**
95
+ * Change the widget style `display` property so that the widget becomes visible.
96
+ */
97
+
98
+
99
+ (0, _createClass2["default"])(Widget, [{
100
+ key: "show",
101
+ value: function show() {
102
+ this.domElement.style.display = (0, _classPrivateFieldGet2["default"])(this, _display);
103
+ }
104
+ /**
105
+ * Change the widget style `display` property so that the widget becomes invisible.
106
+ */
107
+
108
+ }, {
109
+ key: "hide",
110
+ value: function hide() {
111
+ (0, _classPrivateFieldSet2["default"])(this, _display, window.getComputedStyle(this.domElement).display);
112
+ this.domElement.style.display = 'none';
113
+ }
114
+ }]);
115
+ return Widget;
116
+ }();
117
+
118
+ var _default = Widget;
119
+ exports["default"] = _default;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "itowns",
3
- "version": "2.37.0",
3
+ "version": "2.38.2",
4
4
  "description": "A JS/WebGL framework for 3D geospatial data visualization",
5
5
  "main": "lib/Main.js",
6
+ "exports": {
7
+ ".": "./lib/Main.js",
8
+ "./widgets": "./lib/Utils/gui/Main.js"
9
+ },
6
10
  "scripts": {
7
11
  "lint": "eslint \"src/**/*.js\" \"test/**/*.js\" \"examples/**/*.js\" \"docs/*.js\"",
8
12
  "doc": "jsdoc --readme docs/HOMEPAGE.md -c docs/config.json",
@@ -47,8 +51,8 @@
47
51
  },
48
52
  "homepage": "https://itowns.github.io/",
49
53
  "dependencies": {
50
- "@loaders.gl/las": "^3.1.3",
51
- "@mapbox/mapbox-gl-style-spec": "^13.23.0",
54
+ "@loaders.gl/las": "^3.1.7",
55
+ "@mapbox/mapbox-gl-style-spec": "^13.23.1",
52
56
  "@mapbox/vector-tile": "^1.3.1",
53
57
  "@tmcw/togeojson": "^4.5.0",
54
58
  "@tweenjs/tween.js": "^18.6.4",
@@ -61,13 +65,14 @@
61
65
  },
62
66
  "peerDependencies": {
63
67
  "proj4": "^2.7.5",
64
- "three": "0.135.0"
68
+ "three": "0.137.5"
65
69
  },
66
70
  "devDependencies": {
67
- "@babel/cli": "^7.16.0",
68
- "@babel/plugin-transform-runtime": "^7.16.5",
69
- "@babel/preset-env": "^7.16.5",
70
- "@babel/register": "^7.16.5",
71
+ "@babel/cli": "^7.17.0",
72
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
73
+ "@babel/plugin-transform-runtime": "^7.17.0",
74
+ "@babel/preset-env": "^7.16.11",
75
+ "@babel/register": "^7.17.0",
71
76
  "babel-inline-import-loader": "^1.0.1",
72
77
  "babel-loader": "^8.2.3",
73
78
  "babel-plugin-inline-import": "^3.0.0",
@@ -75,35 +80,35 @@
75
80
  "babel-plugin-minify-replace": "^0.5.0",
76
81
  "babel-plugin-module-resolver": "^4.1.0",
77
82
  "chalk": "^4.1.2",
78
- "chart.js": "^3.6.2",
83
+ "chart.js": "^3.7.0",
79
84
  "compare-func": "^2.0.0",
80
- "conventional-changelog-cli": "^2.1.1",
85
+ "conventional-changelog-cli": "^2.2.2",
81
86
  "copyfiles": "^2.4.1",
82
- "core-js": "^3.20.0",
87
+ "core-js": "^3.21.0",
83
88
  "cross-env": "^7.0.3",
84
- "eslint": "^8.5.0",
89
+ "eslint": "^8.8.0",
85
90
  "eslint-config-airbnb-base": "^15.0.0",
86
91
  "eslint-import-resolver-webpack": "^0.13.2",
87
- "eslint-plugin-import": "^2.25.3",
92
+ "eslint-plugin-import": "^2.25.4",
88
93
  "eslint-webpack-plugin": "^3.1.1",
89
94
  "github-url-from-git": "^1.5.0",
90
95
  "grunt": "^1.4.1",
91
96
  "grunt-bump": "^0.8.0",
92
97
  "https-proxy-agent": "^5.0.0",
93
- "jsdoc": "^3.6.7",
94
- "marked": "^4.0.8",
95
- "mocha": "^9.1.3",
96
- "node-fetch": "^2.6.6",
98
+ "jsdoc": "^3.6.10",
99
+ "marked": "^4.0.12",
100
+ "mocha": "^9.2.0",
101
+ "node-fetch": "^2.6.7",
97
102
  "nyc": "^15.1.0",
98
103
  "proj4": "^2.7.5",
99
- "puppeteer": "^13.0.0",
104
+ "puppeteer": "^13.2.0",
100
105
  "q": "^1.5.1",
101
106
  "replace-in-file": "^6.3.2",
102
- "three": "0.135.0",
107
+ "three": "0.137.5",
103
108
  "url-polyfill": "^1.1.12",
104
- "webpack": "^5.65.0",
105
- "webpack-cli": "^4.9.1",
106
- "webpack-dev-server": "^4.6.0",
109
+ "webpack": "^5.68.0",
110
+ "webpack-cli": "^4.9.2",
111
+ "webpack-dev-server": "^4.7.4",
107
112
  "whatwg-fetch": "^3.6.2"
108
113
  }
109
114
  }
@@ -1,60 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg version="1.2" width="45.56mm" height="154.55mm" viewBox="8073 6473 4556 15455" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
4
- <defs class="EmbeddedBulletChars">
5
- <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
6
- <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
7
- </g>
8
- <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
9
- <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
10
- </g>
11
- <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
12
- <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
13
- </g>
14
- <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
15
- <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
16
- </g>
17
- <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
18
- <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
19
- </g>
20
- <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
21
- <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
22
- </g>
23
- <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
24
- <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
25
- </g>
26
- <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
27
- <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
28
- </g>
29
- <g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
30
- <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
31
- </g>
32
- <g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
33
- <path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
34
- </g>
35
- </defs>
36
- <g class="Page">
37
- <g class="com.sun.star.drawing.CustomShape">
38
- <g id="id3">
39
- <rect class="BoundingBox" stroke="none" fill="none" x="8073" y="6473" width="4556" height="7756"/>
40
- <g>
41
- <defs>
42
- <linearGradient id="gradient1" x1="7842" y1="10175" x2="12859" y2="10525" gradientUnits="userSpaceOnUse">
43
- <stop offset="0" style="stop-color:rgb(255,39,39)"/>
44
- <stop offset="1" style="stop-color:rgb(195,3,3)"/>
45
- </linearGradient>
46
- </defs>
47
- <path style="fill:url(#gradient1)" d="M 10350,6500 L 12601,14201 8100,14201 10350,6500 Z"/>
48
- </g>
49
- <path fill="none" stroke="rgb(0,0,0)" stroke-width="53" stroke-linejoin="round" d="M 10350,6500 L 12601,14201 8100,14201 10350,6500 Z"/>
50
- </g>
51
- </g>
52
- <g class="com.sun.star.drawing.CustomShape">
53
- <g id="id4">
54
- <rect class="BoundingBox" stroke="none" fill="none" x="8073" y="14172" width="4556" height="7756"/>
55
- <path fill="rgb(255,255,255)" stroke="none" d="M 10350,21900 L 12601,14199 8100,14199 10350,21900 Z"/>
56
- <path fill="none" stroke="rgb(0,0,0)" stroke-width="53" stroke-linejoin="round" d="M 10350,21900 L 12601,14199 8100,14199 10350,21900 Z"/>
57
- </g>
58
- </g>
59
- </g>
60
- </svg>
@@ -1,66 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg version="1.2" width="79.01mm" height="158.01mm" viewBox="5500 2100 7901 15801" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xml:space="preserve">
4
- <defs class="EmbeddedBulletChars">
5
- <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
6
- <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
7
- </g>
8
- <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
9
- <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
10
- </g>
11
- <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
12
- <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
13
- </g>
14
- <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
15
- <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
16
- </g>
17
- <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
18
- <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
19
- </g>
20
- <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
21
- <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
22
- </g>
23
- <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
24
- <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
25
- </g>
26
- <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
27
- <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
28
- </g>
29
- <g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
30
- <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
31
- </g>
32
- <g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
33
- <path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
34
- </g>
35
- </defs>
36
- <g class="Page">
37
- <g class="com.sun.star.drawing.CustomShape">
38
- <g id="id3">
39
- <rect class="BoundingBox" stroke="none" fill="none" x="5899" y="5100" width="7103" height="1902"/>
40
- <path fill="rgb(255,255,255)" stroke="none" d="M 6216,5100 L 6217,5100 C 6161,5100 6107,5115 6058,5142 6010,5170 5970,5210 5942,5258 5915,5307 5900,5361 5900,5417 L 5900,6684 5900,6684 C 5900,6740 5915,6794 5942,6843 5970,6891 6010,6931 6058,6959 6107,6986 6161,7001 6217,7001 L 12684,7001 12684,7001 C 12740,7001 12794,6986 12843,6959 12891,6931 12931,6891 12959,6843 12986,6794 13001,6740 13001,6684 L 13001,5416 13001,5417 13001,5417 C 13001,5361 12986,5307 12959,5258 12931,5210 12891,5170 12843,5142 12794,5115 12740,5100 12684,5100 L 6216,5100 Z"/>
41
- </g>
42
- </g>
43
- <g class="com.sun.star.drawing.CustomShape">
44
- <g id="id4">
45
- <rect class="BoundingBox" stroke="none" fill="none" x="5500" y="2100" width="7901" height="7901"/>
46
- </g>
47
- </g>
48
- <g class="com.sun.star.drawing.CustomShape">
49
- <g id="id5">
50
- <rect class="BoundingBox" stroke="none" fill="none" x="8499" y="2499" width="1903" height="7103"/>
51
- <path fill="rgb(255,255,255)" stroke="none" d="M 8500,9285 L 8500,9284 C 8500,9340 8515,9394 8542,9443 8570,9491 8610,9531 8658,9559 8707,9586 8761,9601 8817,9601 L 10084,9601 10084,9601 C 10140,9601 10194,9586 10243,9559 10291,9531 10331,9491 10359,9443 10386,9394 10401,9340 10401,9284 L 10401,2817 10401,2817 C 10401,2761 10386,2707 10359,2658 10331,2610 10291,2570 10243,2542 10194,2515 10140,2500 10084,2500 L 8816,2500 8817,2500 8817,2500 C 8761,2500 8707,2515 8658,2542 8610,2570 8570,2610 8542,2658 8515,2707 8500,2761 8500,2817 L 8500,9285 Z"/>
52
- </g>
53
- </g>
54
- <g class="com.sun.star.drawing.CustomShape">
55
- <g id="id6">
56
- <rect class="BoundingBox" stroke="none" fill="none" x="5899" y="13000" width="7103" height="1902"/>
57
- <path fill="rgb(255,255,255)" stroke="none" d="M 6216,13000 L 6217,13000 C 6161,13000 6107,13015 6058,13042 6010,13070 5970,13110 5942,13158 5915,13207 5900,13261 5900,13317 L 5900,14584 5900,14584 C 5900,14640 5915,14694 5942,14743 5970,14791 6010,14831 6058,14859 6107,14886 6161,14901 6217,14901 L 12684,14901 12684,14901 C 12740,14901 12794,14886 12843,14859 12891,14831 12931,14791 12959,14743 12986,14694 13001,14640 13001,14584 L 13001,13316 13001,13317 13001,13317 C 13001,13261 12986,13207 12959,13158 12931,13110 12891,13070 12843,13042 12794,13015 12740,13000 12684,13000 L 6216,13000 Z"/>
58
- </g>
59
- </g>
60
- <g class="com.sun.star.drawing.CustomShape">
61
- <g id="id7">
62
- <rect class="BoundingBox" stroke="none" fill="none" x="5500" y="10000" width="7901" height="7901"/>
63
- </g>
64
- </g>
65
- </g>
66
- </svg>