itowns 2.36.2 → 2.38.1
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/CONTRIBUTING.md +30 -17
- package/README.md +12 -1
- package/changelog.md +138 -0
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +2 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +2 -2
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_widgets.js +2 -0
- package/dist/itowns_widgets.js.map +1 -0
- package/examples/config.json +28 -6
- package/examples/css/example.css +21 -1
- package/examples/css/widgets.css +360 -0
- package/examples/geoid_geoidLayer.html +102 -0
- package/examples/images/code-logo.svg +43 -0
- package/examples/index.html +5 -5
- package/examples/itowns-potree.html +252 -0
- package/examples/js/GUI/GuiTools.js +17 -0
- package/examples/mars.html +0 -1
- package/examples/misc_orthographic_camera.html +7 -19
- package/examples/source_file_from_fetched_data.html +90 -0
- package/examples/source_file_from_format.html +85 -0
- package/examples/source_file_from_methods.html +87 -0
- package/examples/source_file_from_parsed_data.html +104 -0
- package/examples/source_file_geojson_raster.html +21 -45
- package/examples/source_file_gpx_raster.html +28 -36
- package/examples/source_file_kml_raster.html +1 -4
- package/examples/source_file_shapefile.html +39 -34
- package/examples/source_stream_wfs_25d.html +21 -13
- package/examples/source_stream_wfs_3d.html +21 -12
- package/examples/source_stream_wfs_raster.html +20 -20
- package/examples/vector_tile_3d_mesh.html +155 -0
- package/examples/vector_tile_raster_3d.html +0 -5
- package/examples/view_25d_map.html +6 -19
- package/examples/view_2d_map.html +6 -19
- package/examples/view_3d_map.html +106 -81
- package/examples/view_immersive.html +13 -14
- package/examples/widgets_minimap.html +124 -0
- package/examples/widgets_navigation.html +124 -0
- package/examples/widgets_scale.html +96 -0
- package/examples/widgets_searchbar.html +124 -0
- package/lib/Controls/GlobeControls.js +13 -0
- package/lib/Controls/PlanarControls.js +11 -43
- package/lib/Converter/Feature2Mesh.js +203 -45
- package/lib/Converter/convertToTile.js +13 -4
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +4 -1
- package/lib/Core/Deprecated/Undeprecator.js +1 -1
- package/lib/Core/Feature.js +60 -34
- package/lib/Core/Geographic/Extent.js +1 -1
- package/lib/Core/Geographic/GeoidGrid.js +143 -0
- package/lib/Core/MainLoop.js +137 -63
- package/lib/Core/Math/Ellipsoid.js +1 -1
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -1
- package/lib/Core/Prefab/Planar/PlanarLayer.js +3 -1
- package/lib/Core/Style.js +1 -1
- package/lib/Core/TileGeometry.js +3 -1
- package/lib/Core/TileMesh.js +32 -22
- package/lib/Core/View.js +81 -15
- package/lib/Layer/ElevationLayer.js +6 -2
- package/lib/Layer/FeatureGeometryLayer.js +36 -7
- package/lib/Layer/GeoidLayer.js +142 -0
- package/lib/Layer/GeometryLayer.js +6 -54
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/Layer.js +1 -1
- package/lib/Layer/LayerUpdateStrategy.js +1 -1
- package/lib/Layer/OrientedImageLayer.js +1 -0
- package/lib/Layer/PotreeLayer.js +3 -1
- package/lib/Layer/RasterLayer.js +3 -1
- package/lib/Layer/ReferencingLayerProperties.js +50 -0
- package/lib/Layer/TiledGeometryLayer.js +3 -1
- package/lib/Main.js +214 -174
- package/lib/MainBundle.js +1 -1
- package/lib/Parser/B3dmParser.js +5 -3
- package/lib/Parser/GDFParser.js +118 -0
- package/lib/Parser/GTXParser.js +92 -0
- package/lib/Parser/GeoJsonParser.js +29 -7
- package/lib/Parser/ISGParser.js +121 -0
- package/lib/Parser/LASParser.js +3 -1
- package/lib/Parser/VectorTileParser.js +4 -3
- package/lib/Parser/XbilParser.js +1 -1
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +1 -1
- package/lib/Process/3dTilesProcessing.js +2 -2
- package/lib/Process/FeatureProcessing.js +38 -86
- package/lib/Process/LayeredMaterialNodeProcessing.js +16 -7
- package/lib/Process/ObjectRemovalHelper.js +4 -0
- package/lib/Provider/3dTilesProvider.js +2 -7
- package/lib/Provider/Fetcher.js +4 -1
- package/lib/Provider/TileProvider.js +18 -2
- package/lib/Provider/URLBuilder.js +1 -1
- package/lib/Renderer/Camera.js +33 -12
- package/lib/Renderer/ColorLayersOrdering.js +3 -1
- package/lib/Renderer/LayeredMaterial.js +34 -9
- package/lib/Renderer/OBB.js +22 -25
- package/lib/Renderer/OrientedImageMaterial.js +8 -5
- package/lib/Renderer/PointsMaterial.js +6 -6
- package/lib/Renderer/RasterTile.js +1 -1
- package/lib/Renderer/RenderMode.js +3 -1
- package/lib/Renderer/Shader/ShaderChunk.js +5 -1
- package/lib/Renderer/Shader/ShaderUtils.js +4 -2
- package/lib/Renderer/c3DEngine.js +9 -6
- package/lib/Source/C3DTilesSource.js +3 -1
- package/lib/Source/EntwinePointTileSource.js +3 -1
- package/lib/Source/FileSource.js +8 -1
- package/lib/Source/PotreeSource.js +3 -1
- package/lib/Source/Source.js +15 -10
- package/lib/Source/VectorTilesSource.js +5 -0
- package/lib/Source/WFSSource.js +9 -3
- package/lib/Source/WMTSSource.js +3 -1
- package/lib/ThreeExtended/{WebGL.js → capabilities/WebGL.js} +8 -7
- package/lib/ThreeExtended/loaders/GLTFLoader.js +88 -39
- package/lib/Utils/CameraUtils.js +11 -1
- package/lib/Utils/DEMUtils.js +4 -2
- package/lib/Utils/FeaturesUtils.js +8 -4
- package/lib/Utils/gui/Main.js +39 -0
- package/lib/Utils/gui/Minimap.js +197 -0
- package/lib/Utils/gui/Navigation.js +322 -0
- package/lib/Utils/gui/Scale.js +154 -0
- package/lib/Utils/gui/Searchbar.js +299 -0
- package/lib/Utils/gui/Widget.js +119 -0
- package/package.json +32 -27
- package/examples/js/Scale.js +0 -40
|
@@ -39,7 +39,8 @@ var textureVS = "#include <itowns/WebGL2_pars_vertex>\n#include <itowns/precisio
|
|
|
39
39
|
/* babel-plugin-inline-import './Shader/ProjectiveTextureFS.glsl' */
|
|
40
40
|
var textureFS = "#include <itowns/WebGL2_pars_fragment>\n#include <itowns/precision_qualifier>\n#include <logdepthbuf_pars_fragment>\n#include <itowns/projective_texturing_pars_fragment>\nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include <logdepthbuf_fragment>\n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n";
|
|
41
41
|
var ndcToTextureMatrix = new THREE.Matrix4().set(1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 0, 2);
|
|
42
|
-
var noMask = new THREE.DataTexture(new Uint8Array([255, 255, 255]), 1, 1, THREE.
|
|
42
|
+
var noMask = new THREE.DataTexture(new Uint8Array([255, 255, 255, 255]), 1, 1, THREE.RGBAFormat, THREE.UnsignedByteType);
|
|
43
|
+
noMask.needsUpdate = true;
|
|
43
44
|
var noTexture = new THREE.Texture();
|
|
44
45
|
var rawShaderMaterial = new THREE.RawShaderMaterial();
|
|
45
46
|
/**
|
|
@@ -85,13 +86,15 @@ var OrientedImageMaterial = /*#__PURE__*/function (_THREE$RawShaderMater) {
|
|
|
85
86
|
* @param {Number} [options.debugAlphaBorder=0] - Set this option to 1 to see influence of alphaBorder option.
|
|
86
87
|
*/
|
|
87
88
|
function OrientedImageMaterial(cameras) {
|
|
89
|
+
var _options$side, _options$transparent, _options$opacity, _options$OrientedImag;
|
|
90
|
+
|
|
88
91
|
var _this;
|
|
89
92
|
|
|
90
93
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
91
94
|
(0, _classCallCheck2["default"])(this, OrientedImageMaterial);
|
|
92
|
-
options.side = options.side !==
|
|
93
|
-
options.transparent = options.transparent !==
|
|
94
|
-
options.opacity = options.opacity !==
|
|
95
|
+
options.side = (_options$side = options.side) !== null && _options$side !== void 0 ? _options$side : THREE.DoubleSide;
|
|
96
|
+
options.transparent = (_options$transparent = options.transparent) !== null && _options$transparent !== void 0 ? _options$transparent : true;
|
|
97
|
+
options.opacity = (_options$opacity = options.opacity) !== null && _options$opacity !== void 0 ? _options$opacity : 1; // Filter the rawShaderMaterial options
|
|
95
98
|
|
|
96
99
|
var rawShaderMaterialOptions = {};
|
|
97
100
|
|
|
@@ -106,7 +109,7 @@ var OrientedImageMaterial = /*#__PURE__*/function (_THREE$RawShaderMater) {
|
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
_this = _super.call(this, rawShaderMaterialOptions);
|
|
109
|
-
_this.defines.ORIENTED_IMAGES_COUNT = options.OrientedImagesCount !==
|
|
112
|
+
_this.defines.ORIENTED_IMAGES_COUNT = (_options$OrientedImag = options.OrientedImagesCount) !== null && _options$OrientedImag !== void 0 ? _options$OrientedImag : cameras.length; // verify that number of textures doesn't exceed GPU capabilities
|
|
110
113
|
|
|
111
114
|
var maxTexturesUnits = _Capabilities["default"].getMaxTextureUnitsCount();
|
|
112
115
|
|
|
@@ -7,9 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports["default"] = exports.
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
exports["default"] = exports.MODE = exports.ClassificationScheme = void 0;
|
|
13
11
|
|
|
14
12
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
13
|
|
|
@@ -21,6 +19,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
21
19
|
|
|
22
20
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
21
|
|
|
22
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
+
|
|
24
24
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
25
25
|
|
|
26
26
|
var THREE = _interopRequireWildcard(require("three"));
|
|
@@ -69,10 +69,9 @@ var white = new THREE.Color(1.0, 1.0, 1.0);
|
|
|
69
69
|
|
|
70
70
|
var
|
|
71
71
|
/* istanbul ignore next */
|
|
72
|
-
Classification = function Classification() {
|
|
72
|
+
Classification = /*#__PURE__*/(0, _createClass2["default"])(function Classification() {
|
|
73
73
|
(0, _classCallCheck2["default"])(this, Classification);
|
|
74
|
-
};
|
|
75
|
-
|
|
74
|
+
});
|
|
76
75
|
var ClassificationScheme = {
|
|
77
76
|
DEFAULT: {
|
|
78
77
|
0: {
|
|
@@ -221,6 +220,7 @@ var PointsMaterial = /*#__PURE__*/function (_THREE$RawShaderMater) {
|
|
|
221
220
|
|
|
222
221
|
var data = new Uint8Array(256 * 4);
|
|
223
222
|
var texture = new THREE.DataTexture(data, 256, 1, THREE.RGBAFormat);
|
|
223
|
+
texture.needsUpdate = true;
|
|
224
224
|
texture.magFilter = THREE.NearestFilter;
|
|
225
225
|
|
|
226
226
|
_CommonMaterial["default"].setUniformProperty((0, _assertThisInitialized2["default"])(_this), 'classificationLUT', texture); // Classification scheme
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports
|
|
10
|
+
exports["default"] = exports.RasterElevationTile = exports.RasterColorTile = exports.EMPTY_TEXTURE_ZOOM = void 0;
|
|
11
11
|
|
|
12
12
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
13
|
|
|
@@ -14,7 +14,9 @@ var MODES = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
function push(object3d, mode) {
|
|
17
|
-
var
|
|
17
|
+
var _object3d$mode;
|
|
18
|
+
|
|
19
|
+
var _mode = (_object3d$mode = object3d.mode) !== null && _object3d$mode !== void 0 ? _object3d$mode : MODES.FINAL;
|
|
18
20
|
|
|
19
21
|
if (_mode == mode) {
|
|
20
22
|
return function () {};
|
|
@@ -23,11 +23,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
var color_layers_pars_fragment = "struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include <itowns/custom_header_colorLayer>\n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color, float intensity) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a *= 1.0 - pow(abs(a), intensity);\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include <itowns/custom_body_colorLayer>\n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color, layer.effect_parameter);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n";
|
|
24
24
|
|
|
25
25
|
/* babel-plugin-inline-import './Chunk/elevation_pars_vertex.glsl' */
|
|
26
|
-
var elevation_pars_vertex = "#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n #if defined(WEBGL2)\n return texture2D( tex, uv ).r;\n #else\n return texture2D( tex, uv ).w;\n #endif\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = getElevationMode(uv, tex, layer.mode);\n if (d < layer.zmin || d > layer.zmax) d = 0.;\n return d * layer.scale + layer.bias;\n }\n#endif\n";
|
|
26
|
+
var elevation_pars_vertex = "#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n #if defined(WEBGL2)\n return texture2D( tex, uv ).r;\n #else\n return texture2D( tex, uv ).w;\n #endif\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = getElevationMode(uv, tex, layer.mode);\n if (d < layer.zmin || d > layer.zmax) d = 0.;\n return d * layer.scale + layer.bias;\n }\n#endif\n";
|
|
27
27
|
|
|
28
28
|
/* babel-plugin-inline-import './Chunk/elevation_vertex.glsl' */
|
|
29
29
|
var elevation_vertex = "#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n";
|
|
30
30
|
|
|
31
|
+
/* babel-plugin-inline-import './Chunk/geoid_vertex.glsl' */
|
|
32
|
+
var geoid_vertex = "transformed += geoidHeight * normal;\n";
|
|
33
|
+
|
|
31
34
|
/* babel-plugin-inline-import './Chunk/fog_fragment.glsl' */
|
|
32
35
|
var fog_fragment = "#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n";
|
|
33
36
|
|
|
@@ -86,6 +89,7 @@ var itownsShaderChunk = {
|
|
|
86
89
|
custom_header_colorLayer: custom_header_colorLayer,
|
|
87
90
|
elevation_pars_vertex: elevation_pars_vertex,
|
|
88
91
|
elevation_vertex: elevation_vertex,
|
|
92
|
+
geoid_vertex: geoid_vertex,
|
|
89
93
|
fog_fragment: fog_fragment,
|
|
90
94
|
fog_pars_fragment: fog_pars_fragment,
|
|
91
95
|
lighting_fragment: lighting_fragment,
|
|
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var pattern_gl_Position = 'gl_Position.*(?![^]*gl_Position)';
|
|
8
|
+
var pattern_Main = '[^\\w]*main[^\\w]*(void)?[^\\w]*{';
|
|
9
|
+
var rePosition = new RegExp(pattern_gl_Position);
|
|
10
|
+
var reMain = new RegExp(pattern_Main);
|
|
9
11
|
var _default = {
|
|
10
12
|
patchMaterialForLogDepthSupport: function patchMaterialForLogDepthSupport(material) {
|
|
11
13
|
// Check if the shader does not already use the log depth buffer
|
|
@@ -19,7 +19,7 @@ var _Capabilities = _interopRequireDefault(require("../Core/System/Capabilities"
|
|
|
19
19
|
|
|
20
20
|
var _LayeredMaterial = require("./LayeredMaterial");
|
|
21
21
|
|
|
22
|
-
var _WebGL = require("../ThreeExtended/WebGL");
|
|
22
|
+
var _WebGL = _interopRequireDefault(require("../ThreeExtended/capabilities/WebGL"));
|
|
23
23
|
|
|
24
24
|
var _Label2DRenderer = _interopRequireDefault(require("./Label2DRenderer"));
|
|
25
25
|
|
|
@@ -84,7 +84,10 @@ var c3DEngine = /*#__PURE__*/function () {
|
|
|
84
84
|
this.renderView = function (view) {
|
|
85
85
|
this.renderer.clear();
|
|
86
86
|
this.renderer.render(view.scene, view.camera.camera3D);
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
if (view.tileLayer) {
|
|
89
|
+
this.label2dRenderer.render(view.tileLayer.object3d, view.camera.camera3D);
|
|
90
|
+
}
|
|
88
91
|
}.bind(this);
|
|
89
92
|
|
|
90
93
|
this.onWindowResize = function (w, h) {
|
|
@@ -116,10 +119,10 @@ var c3DEngine = /*#__PURE__*/function () {
|
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
if (!this.renderer) {
|
|
119
|
-
if (!_WebGL.
|
|
120
|
-
viewerDiv.appendChild(_WebGL.
|
|
121
|
-
} else if (!_WebGL.
|
|
122
|
-
viewerDiv.appendChild(_WebGL.
|
|
122
|
+
if (!_WebGL["default"].isWebGLAvailable()) {
|
|
123
|
+
viewerDiv.appendChild(_WebGL["default"].getErrorMessage(1));
|
|
124
|
+
} else if (!_WebGL["default"].isWebGL2Available()) {
|
|
125
|
+
viewerDiv.appendChild(_WebGL["default"].getErrorMessage(2));
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
throw new Error('WebGL unsupported');
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
@@ -38,7 +40,7 @@ var C3DTilesSource = /*#__PURE__*/function (_Source) {
|
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
return C3DTilesSource;
|
|
43
|
+
return (0, _createClass2["default"])(C3DTilesSource);
|
|
42
44
|
}(_Source2["default"]);
|
|
43
45
|
|
|
44
46
|
var _default = C3DTilesSource;
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -98,7 +100,7 @@ var EntwinePointTileSource = /*#__PURE__*/function (_Source) {
|
|
|
98
100
|
return _this;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
return EntwinePointTileSource;
|
|
103
|
+
return (0, _createClass2["default"])(EntwinePointTileSource);
|
|
102
104
|
}(_Source2["default"]);
|
|
103
105
|
|
|
104
106
|
var _default = EntwinePointTileSource;
|
package/lib/Source/FileSource.js
CHANGED
|
@@ -107,7 +107,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
107
107
|
* .then(function _(geojson) {
|
|
108
108
|
* return itowns.GeoJsonParser.parse(geojson, {
|
|
109
109
|
* in: { crs: 'EPSG:4326' },
|
|
110
|
-
* out: { crs: view.tileLayer.extent.crs
|
|
110
|
+
* out: { crs: view.tileLayer.extent.crs,
|
|
111
|
+
* style: new itowns.Style({
|
|
112
|
+
* fill: {
|
|
113
|
+
* color: new itowns.THREE.Color(0xffcc00),
|
|
114
|
+
* extrusion_height: () => 5000,
|
|
115
|
+
* }),
|
|
116
|
+
* },
|
|
117
|
+
* },
|
|
111
118
|
* });
|
|
112
119
|
* }).then(function _(features) {
|
|
113
120
|
* ariege.source = new itowns.FileSource({
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
@@ -116,7 +118,7 @@ var PotreeSource = /*#__PURE__*/function (_Source) {
|
|
|
116
118
|
return _this;
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
return PotreeSource;
|
|
121
|
+
return (0, _createClass2["default"])(PotreeSource);
|
|
120
122
|
}(_Source2["default"]);
|
|
121
123
|
|
|
122
124
|
var _default = PotreeSource;
|
package/lib/Source/Source.js
CHANGED
|
@@ -5,9 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
+
exports.supportedParsers = exports.supportedFetchers = exports["default"] = void 0;
|
|
11
9
|
|
|
12
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
11
|
|
|
@@ -15,6 +13,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
15
13
|
|
|
16
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
15
|
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
|
|
18
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
19
|
|
|
20
20
|
var _Extent = _interopRequireDefault(require("../Core/Geographic/Extent"));
|
|
@@ -23,8 +23,14 @@ var _GeoJsonParser = _interopRequireDefault(require("../Parser/GeoJsonParser"));
|
|
|
23
23
|
|
|
24
24
|
var _KMLParser = _interopRequireDefault(require("../Parser/KMLParser"));
|
|
25
25
|
|
|
26
|
+
var _GDFParser = _interopRequireDefault(require("../Parser/GDFParser"));
|
|
27
|
+
|
|
26
28
|
var _GpxParser = _interopRequireDefault(require("../Parser/GpxParser"));
|
|
27
29
|
|
|
30
|
+
var _GTXParser = _interopRequireDefault(require("../Parser/GTXParser"));
|
|
31
|
+
|
|
32
|
+
var _ISGParser = _interopRequireDefault(require("../Parser/ISGParser"));
|
|
33
|
+
|
|
28
34
|
var _VectorTileParser = _interopRequireDefault(require("../Parser/VectorTileParser"));
|
|
29
35
|
|
|
30
36
|
var _Fetcher = _interopRequireDefault(require("../Provider/Fetcher"));
|
|
@@ -35,9 +41,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
35
41
|
|
|
36
42
|
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; } }
|
|
37
43
|
|
|
38
|
-
var supportedFetchers = new Map([['image/x-bil;bits=32', _Fetcher["default"].textureFloat], ['geojson', _Fetcher["default"].json], ['application/json', _Fetcher["default"].json], ['application/kml', _Fetcher["default"].xml], ['application/gpx', _Fetcher["default"].xml], ['application/x-protobuf;type=mapbox-vector', _Fetcher["default"].arrayBuffer]]);
|
|
44
|
+
var supportedFetchers = new Map([['image/x-bil;bits=32', _Fetcher["default"].textureFloat], ['geojson', _Fetcher["default"].json], ['application/json', _Fetcher["default"].json], ['application/kml', _Fetcher["default"].xml], ['application/gpx', _Fetcher["default"].xml], ['application/x-protobuf;type=mapbox-vector', _Fetcher["default"].arrayBuffer], ['application/gtx', _Fetcher["default"].arrayBuffer], ['application/isg', _Fetcher["default"].text], ['application/gdf', _Fetcher["default"].text]]);
|
|
39
45
|
exports.supportedFetchers = supportedFetchers;
|
|
40
|
-
var supportedParsers = new Map([['geojson', _GeoJsonParser["default"].parse], ['application/json', _GeoJsonParser["default"].parse], ['application/kml', _KMLParser["default"].parse], ['application/gpx', _GpxParser["default"].parse], ['application/x-protobuf;type=mapbox-vector', _VectorTileParser["default"].parse]]);
|
|
46
|
+
var supportedParsers = new Map([['geojson', _GeoJsonParser["default"].parse], ['application/json', _GeoJsonParser["default"].parse], ['application/kml', _KMLParser["default"].parse], ['application/gpx', _GpxParser["default"].parse], ['application/x-protobuf;type=mapbox-vector', _VectorTileParser["default"].parse], ['application/gtx', _GTXParser["default"].parse], ['application/isg', _ISGParser["default"].parse], ['application/gdf', _GDFParser["default"].parse]]);
|
|
41
47
|
exports.supportedParsers = supportedParsers;
|
|
42
48
|
var noCache = {
|
|
43
49
|
getByArray: function getByArray() {},
|
|
@@ -57,7 +63,7 @@ var noCache = {
|
|
|
57
63
|
*
|
|
58
64
|
*/
|
|
59
65
|
|
|
60
|
-
var InformationsData = function InformationsData(options) {
|
|
66
|
+
var InformationsData = /*#__PURE__*/(0, _createClass2["default"])(function InformationsData(options) {
|
|
61
67
|
(0, _classCallCheck2["default"])(this, InformationsData);
|
|
62
68
|
|
|
63
69
|
/* istanbul ignore next */
|
|
@@ -67,7 +73,7 @@ var InformationsData = function InformationsData(options) {
|
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
this.crs = options.crs;
|
|
70
|
-
};
|
|
76
|
+
});
|
|
71
77
|
/**
|
|
72
78
|
* This class describes parsing options.
|
|
73
79
|
* @property {InformationsData|Source} in - data informations contained in the file.
|
|
@@ -75,12 +81,11 @@ var InformationsData = function InformationsData(options) {
|
|
|
75
81
|
*/
|
|
76
82
|
// eslint-disable-next-line
|
|
77
83
|
|
|
78
|
-
|
|
79
84
|
var
|
|
80
85
|
/* istanbul ignore next */
|
|
81
|
-
ParsingOptions = function ParsingOptions() {
|
|
86
|
+
ParsingOptions = /*#__PURE__*/(0, _createClass2["default"])(function ParsingOptions() {
|
|
82
87
|
(0, _classCallCheck2["default"])(this, ParsingOptions);
|
|
83
|
-
};
|
|
88
|
+
});
|
|
84
89
|
|
|
85
90
|
function fetchSourceData(source, extent) {
|
|
86
91
|
var url = source.urlFromExtent(extent);
|
|
@@ -184,6 +184,11 @@ var VectorTilesSource = /*#__PURE__*/function (_TMSSource) {
|
|
|
184
184
|
(0, _get2["default"])((0, _getPrototypeOf2["default"])(VectorTilesSource.prototype), "onLayerAdded", this).call(this, options);
|
|
185
185
|
|
|
186
186
|
if (options.out.style) {
|
|
187
|
+
if (options.out.isFeatureGeometryLayer && options.out.accurate) {
|
|
188
|
+
console.warn('With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false');
|
|
189
|
+
options.out.accurate = false;
|
|
190
|
+
}
|
|
191
|
+
|
|
187
192
|
var keys = Object.keys(this.styles);
|
|
188
193
|
keys.forEach(function (k) {
|
|
189
194
|
_this2.styles[k].parent = options.out.style;
|
package/lib/Source/WFSSource.js
CHANGED
|
@@ -107,10 +107,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
107
107
|
* });
|
|
108
108
|
*
|
|
109
109
|
* // Create the layer
|
|
110
|
-
* const geometryLayer = new itowns.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
110
|
+
* const geometryLayer = new itowns.FeatureGeometryLayer('mesh_build', {
|
|
111
|
+
* style: new itowns.Style({
|
|
112
|
+
* fill: {
|
|
113
|
+
* color: new itowns.THREE.Color(0xffcc00),
|
|
114
|
+
* base_altitude: (p) => p.altitude,
|
|
115
|
+
* extrusion_height: (p) => p.height,
|
|
116
|
+
* }
|
|
117
|
+
* },
|
|
113
118
|
* source: wfsSource,
|
|
119
|
+
* zoom: { min: 14 },
|
|
114
120
|
* });
|
|
115
121
|
*
|
|
116
122
|
* // Add the layer
|
package/lib/Source/WMTSSource.js
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
@@ -102,7 +104,7 @@ var WMTSSource = /*#__PURE__*/function (_TMSSource) {
|
|
|
102
104
|
return _this;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
return WMTSSource;
|
|
107
|
+
return (0, _createClass2["default"])(WMTSSource);
|
|
106
108
|
}(_TMSSource2["default"]);
|
|
107
109
|
|
|
108
110
|
var _default = WMTSSource;
|
|
@@ -5,18 +5,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
(0, _classCallCheck2["default"])(this,
|
|
14
|
+
var WebGL = /*#__PURE__*/function () {
|
|
15
|
+
function WebGL() {
|
|
16
|
+
(0, _classCallCheck2["default"])(this, WebGL);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
(0, _createClass2["default"])(
|
|
19
|
+
(0, _createClass2["default"])(WebGL, null, [{
|
|
20
20
|
key: "isWebGLAvailable",
|
|
21
21
|
value: function isWebGLAvailable() {
|
|
22
22
|
try {
|
|
@@ -80,7 +80,8 @@ var WEBGL = /*#__PURE__*/function () {
|
|
|
80
80
|
return element;
|
|
81
81
|
}
|
|
82
82
|
}]);
|
|
83
|
-
return
|
|
83
|
+
return WebGL;
|
|
84
84
|
}();
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
var _default = WebGL;
|
|
87
|
+
exports["default"] = _default;
|