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.
- package/README.md +12 -1
- package/changelog.md +101 -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 +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/config.json +4 -1
- package/examples/css/example.css +21 -1
- package/examples/css/widgets.css +118 -6
- package/examples/images/code-logo.svg +43 -0
- package/examples/index.html +5 -5
- package/examples/mars.html +0 -1
- package/examples/misc_orthographic_camera.html +7 -19
- 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/widgets_minimap.html +3 -1
- package/examples/widgets_navigation.html +6 -1
- package/examples/widgets_scale.html +96 -0
- package/examples/widgets_searchbar.html +124 -0
- package/lib/Controls/PlanarControls.js +10 -42
- package/lib/Converter/Feature2Mesh.js +225 -61
- package/lib/Converter/Feature2Texture.js +4 -3
- package/lib/Converter/convertToTile.js +10 -5
- package/lib/Core/Feature.js +57 -30
- package/lib/Core/MainLoop.js +136 -62
- package/lib/Core/TileMesh.js +21 -5
- package/lib/Core/View.js +46 -15
- package/lib/Layer/FeatureGeometryLayer.js +37 -10
- package/lib/Layer/GeoidLayer.js +17 -6
- package/lib/Layer/GeometryLayer.js +6 -54
- package/lib/Layer/OrientedImageLayer.js +1 -0
- package/lib/Layer/RasterLayer.js +3 -1
- package/lib/Layer/ReferencingLayerProperties.js +50 -0
- package/lib/Main.js +1 -1
- package/lib/Parser/B3dmParser.js +3 -2
- package/lib/Parser/GeoJsonParser.js +29 -7
- package/lib/Parser/VectorTileParser.js +5 -4
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +3 -3
- package/lib/Process/3dTilesProcessing.js +3 -3
- package/lib/Process/FeatureProcessing.js +36 -86
- package/lib/Process/LayeredMaterialNodeProcessing.js +9 -3
- package/lib/Process/ObjectRemovalHelper.js +4 -0
- package/lib/Provider/3dTilesProvider.js +2 -7
- package/lib/Provider/Fetcher.js +5 -2
- package/lib/Provider/TileProvider.js +18 -2
- package/lib/Renderer/Camera.js +33 -12
- package/lib/Renderer/ColorLayersOrdering.js +3 -1
- package/lib/Renderer/LayeredMaterial.js +32 -7
- package/lib/Renderer/OBB.js +8 -4
- package/lib/Renderer/OrientedImageMaterial.js +8 -5
- package/lib/Renderer/PointsMaterial.js +1 -0
- package/lib/Renderer/RenderMode.js +3 -1
- package/lib/Renderer/Shader/ShaderChunk.js +5 -1
- package/lib/Renderer/c3DEngine.js +9 -6
- package/lib/Source/FileSource.js +8 -1
- package/lib/Source/VectorTilesSource.js +5 -0
- package/lib/Source/WFSSource.js +9 -3
- package/lib/ThreeExtended/{WebGL.js → capabilities/WebGL.js} +8 -7
- package/lib/ThreeExtended/loaders/GLTFLoader.js +3 -4
- package/lib/Utils/DEMUtils.js +3 -1
- package/lib/Utils/gui/Main.js +39 -0
- package/lib/Utils/gui/Minimap.js +195 -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 +27 -22
- package/examples/images/compass.svg +0 -60
- package/examples/images/widget-logo.svg +0 -66
- package/examples/js/Scale.js +0 -41
package/examples/js/Scale.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* For a given pixel size, calculates the projected metric distance at the middle of the screen.
|
|
3
|
-
* Calculates then the pixel distance equivalent to the rounded computed metric distance.
|
|
4
|
-
*
|
|
5
|
-
* @param {itowns.View} view View in which the distances are computed.
|
|
6
|
-
* @param {number} pixelSize Distance in pixels, at the center of the view.
|
|
7
|
-
* @return {{pixels: number, meters: number}} The rounded pixel and metric distances.
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line no-unused-vars
|
|
10
|
-
function roundPixelsFromMeters(view, pixelSize) {
|
|
11
|
-
// Calculate the metric distance which match the given pixel distance :
|
|
12
|
-
var distanceMeters = view.getPixelsToMeters(pixelSize);
|
|
13
|
-
|
|
14
|
-
// Round the metric distance :
|
|
15
|
-
distanceMeters = Math.floor(distanceMeters);
|
|
16
|
-
// eslint-disable-next-line prefer-exponentiation-operator
|
|
17
|
-
var digit = Math.pow(10, distanceMeters.toString().length - 1);
|
|
18
|
-
distanceMeters = Math.round(distanceMeters / digit) * digit;
|
|
19
|
-
|
|
20
|
-
// Round the pixel distance to match the rounded metric distance :
|
|
21
|
-
var roundedPixDistance = view.getMetersToPixels(distanceMeters);
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
pixels: roundedPixDistance,
|
|
25
|
-
meters: distanceMeters,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line no-unused-vars
|
|
30
|
-
function getMetersUnit(distanceMeters) {
|
|
31
|
-
var distance = distanceMeters;
|
|
32
|
-
var unit = 'm';
|
|
33
|
-
if (distanceMeters >= 1000) {
|
|
34
|
-
distance /= 1000;
|
|
35
|
-
unit = 'km';
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
distance: distance,
|
|
39
|
-
unit: unit,
|
|
40
|
-
};
|
|
41
|
-
}
|