itowns 2.45.1 → 2.45.2-next.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.
Files changed (224) hide show
  1. package/dist/455.js +1 -1
  2. package/dist/455.js.map +1 -1
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +8 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +1 -1
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_lasparser.js +1 -1
  10. package/dist/itowns_lasparser.js.map +1 -1
  11. package/dist/itowns_lasworker.js +1 -1
  12. package/dist/itowns_lasworker.js.map +1 -1
  13. package/dist/itowns_potree2worker.js +1 -1
  14. package/dist/itowns_potree2worker.js.map +1 -1
  15. package/dist/itowns_widgets.js +1 -1
  16. package/dist/itowns_widgets.js.map +1 -1
  17. package/examples/copc_simple_loader.html +3 -3
  18. package/examples/entwine_3d_loader.html +2 -2
  19. package/examples/entwine_simple_loader.html +10 -6
  20. package/examples/potree2_25d_map.html +2 -2
  21. package/examples/potree_25d_map.html +2 -2
  22. package/examples/potree_3d_map.html +2 -2
  23. package/examples/view_3d_map_webxr.html +2 -5
  24. package/lib/Controls/FirstPersonControls.d.ts +90 -0
  25. package/lib/Controls/FlyControls.d.ts +36 -0
  26. package/lib/Controls/GlobeControls.d.ts +274 -0
  27. package/lib/Controls/PlanarControls.d.ts +339 -0
  28. package/lib/Controls/StateControl.d.ts +140 -0
  29. package/lib/Controls/StreetControls.d.ts +134 -0
  30. package/lib/Controls/VRControls.d.ts +56 -0
  31. package/lib/Controls/VRControls.js +409 -0
  32. package/lib/Converter/Feature2Mesh.d.ts +42 -0
  33. package/lib/Converter/Feature2Texture.d.ts +5 -0
  34. package/lib/Converter/convertToTile.d.ts +5 -0
  35. package/lib/Converter/convertToTile.js +2 -2
  36. package/lib/Converter/textureConverter.d.ts +4 -0
  37. package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
  38. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
  39. package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
  40. package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
  41. package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
  42. package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
  43. package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
  44. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
  45. package/lib/Core/AnimationPlayer.d.ts +53 -0
  46. package/lib/Core/CopcNode.d.ts +68 -0
  47. package/lib/Core/CopcNode.js +57 -74
  48. package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
  49. package/lib/Core/EntwinePointTileNode.d.ts +59 -0
  50. package/lib/Core/EntwinePointTileNode.js +16 -41
  51. package/lib/Core/Feature.d.ts +323 -0
  52. package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
  53. package/lib/Core/Label.d.ts +86 -0
  54. package/lib/Core/MainLoop.d.ts +23 -0
  55. package/lib/Core/Picking.d.ts +6 -0
  56. package/lib/Core/Picking.js +4 -0
  57. package/lib/Core/PointCloudNode.d.ts +16 -0
  58. package/lib/Core/PointCloudNode.js +34 -4
  59. package/lib/Core/Potree2Node.d.ts +11 -0
  60. package/lib/Core/Potree2Node.js +5 -60
  61. package/lib/Core/Potree2PointAttributes.d.ts +97 -0
  62. package/lib/Core/PotreeNode.d.ts +14 -0
  63. package/lib/Core/PotreeNode.js +28 -18
  64. package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
  65. package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
  66. package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
  67. package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
  68. package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
  69. package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
  70. package/lib/Core/Prefab/GlobeView.d.ts +65 -0
  71. package/lib/Core/Prefab/GlobeView.js +9 -0
  72. package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
  73. package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
  74. package/lib/Core/Prefab/PlanarView.d.ts +33 -0
  75. package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
  76. package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
  77. package/lib/Core/Scheduler/Cache.d.ts +25 -0
  78. package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
  79. package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
  80. package/lib/Core/Style.d.ts +248 -0
  81. package/lib/Core/StyleOptions.d.ts +455 -0
  82. package/lib/Core/System/Capabilities.d.ts +9 -0
  83. package/lib/Core/Tile/Tile.d.ts +70 -0
  84. package/lib/Core/Tile/TileGrid.d.ts +12 -0
  85. package/lib/Core/TileGeometry.d.ts +46 -0
  86. package/lib/Core/TileMesh.d.ts +50 -0
  87. package/lib/Core/TileMesh.js +2 -4
  88. package/lib/Core/View.d.ts +403 -0
  89. package/lib/Core/View.js +1 -7
  90. package/lib/Layer/C3DTilesLayer.d.ts +140 -0
  91. package/lib/Layer/ColorLayer.d.ts +128 -0
  92. package/lib/Layer/ColorLayer.js +4 -4
  93. package/lib/Layer/CopcLayer.d.ts +42 -0
  94. package/lib/Layer/CopcLayer.js +3 -6
  95. package/lib/Layer/ElevationLayer.d.ts +96 -0
  96. package/lib/Layer/ElevationLayer.js +3 -3
  97. package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
  98. package/lib/Layer/EntwinePointTileLayer.js +4 -3
  99. package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
  100. package/lib/Layer/GeoidLayer.d.ts +41 -0
  101. package/lib/Layer/GeometryLayer.d.ts +120 -0
  102. package/lib/Layer/InfoLayer.d.ts +24 -0
  103. package/lib/Layer/InfoLayer.js +1 -1
  104. package/lib/Layer/LabelLayer.d.ts +93 -0
  105. package/lib/Layer/LabelLayer.js +2 -2
  106. package/lib/Layer/Layer.d.ts +185 -0
  107. package/lib/Layer/LayerUpdateState.d.ts +24 -0
  108. package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
  109. package/lib/Layer/LayerUpdateStrategy.js +2 -7
  110. package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
  111. package/lib/Layer/OGC3DTilesLayer.js +21 -0
  112. package/lib/Layer/OrientedImageLayer.d.ts +53 -0
  113. package/lib/Layer/PointCloudLayer.d.ts +103 -0
  114. package/lib/Layer/PointCloudLayer.js +8 -11
  115. package/lib/Layer/Potree2Layer.d.ts +56 -0
  116. package/lib/Layer/Potree2Layer.js +0 -2
  117. package/lib/Layer/PotreeLayer.d.ts +55 -0
  118. package/lib/Layer/RasterLayer.d.ts +8 -0
  119. package/lib/Layer/RasterLayer.js +2 -2
  120. package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
  121. package/lib/Layer/ReferencingLayerProperties.js +0 -12
  122. package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
  123. package/lib/Layer/TiledGeometryLayer.js +4 -3
  124. package/lib/Main.d.ts +89 -0
  125. package/lib/Main.js +3 -1
  126. package/lib/Parser/B3dmParser.d.ts +26 -0
  127. package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
  128. package/lib/Parser/GDFParser.d.ts +24 -0
  129. package/lib/Parser/GTXParser.d.ts +28 -0
  130. package/lib/Parser/GeoJsonParser.d.ts +12 -0
  131. package/lib/Parser/GpxParser.d.ts +12 -0
  132. package/lib/Parser/ISGParser.d.ts +23 -0
  133. package/lib/Parser/KMLParser.d.ts +12 -0
  134. package/lib/Parser/LASParser.d.ts +61 -0
  135. package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
  136. package/lib/Parser/PntsParser.d.ts +4 -0
  137. package/lib/Parser/Potree2BinParser.d.ts +8 -0
  138. package/lib/Parser/PotreeBinParser.d.ts +4 -0
  139. package/lib/Parser/PotreeCinParser.d.ts +4 -0
  140. package/lib/Parser/ShapefileParser.d.ts +25 -0
  141. package/lib/Parser/VectorTileParser.d.ts +34 -0
  142. package/lib/Parser/XbilParser.d.ts +18 -0
  143. package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
  144. package/lib/Parser/iGLTFLoader.d.ts +104 -0
  145. package/lib/Process/3dTilesProcessing.d.ts +43 -0
  146. package/lib/Process/FeatureProcessing.d.ts +4 -0
  147. package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
  148. package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
  149. package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
  150. package/lib/Process/handlerNodeError.d.ts +1 -0
  151. package/lib/Provider/3dTilesProvider.d.ts +7 -0
  152. package/lib/Provider/DataSourceProvider.d.ts +4 -0
  153. package/lib/Provider/Fetcher.d.ts +101 -0
  154. package/lib/Provider/PointCloudProvider.d.ts +4 -0
  155. package/lib/Provider/TileProvider.d.ts +4 -0
  156. package/lib/Provider/URLBuilder.d.ts +28 -0
  157. package/lib/Renderer/Camera.d.ts +95 -0
  158. package/lib/Renderer/Color.d.ts +3 -0
  159. package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
  160. package/lib/Renderer/ColorLayersOrdering.js +2 -2
  161. package/lib/Renderer/CommonMaterial.d.ts +6 -0
  162. package/lib/Renderer/Label2DRenderer.d.ts +31 -0
  163. package/lib/Renderer/LayeredMaterial.d.ts +121 -0
  164. package/lib/Renderer/LayeredMaterial.js +221 -141
  165. package/lib/Renderer/OBB.d.ts +65 -0
  166. package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
  167. package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
  168. package/lib/Renderer/PointsMaterial.d.ts +226 -0
  169. package/lib/Renderer/PointsMaterial.js +60 -22
  170. package/lib/Renderer/RasterTile.d.ts +53 -0
  171. package/lib/Renderer/RasterTile.js +8 -9
  172. package/lib/Renderer/RenderMode.d.ts +11 -0
  173. package/lib/Renderer/RenderMode.js +1 -0
  174. package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
  175. package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
  176. package/lib/Renderer/WebXR.d.ts +33 -0
  177. package/lib/Renderer/WebXR.js +128 -47
  178. package/lib/Renderer/c3DEngine.d.ts +55 -0
  179. package/lib/Renderer/c3DEngine.js +5 -1
  180. package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
  181. package/lib/Source/C3DTilesIonSource.d.ts +31 -0
  182. package/lib/Source/C3DTilesSource.d.ts +17 -0
  183. package/lib/Source/CopcSource.d.ts +79 -0
  184. package/lib/Source/EntwinePointTileSource.d.ts +40 -0
  185. package/lib/Source/EntwinePointTileSource.js +0 -5
  186. package/lib/Source/FileSource.d.ts +118 -0
  187. package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
  188. package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
  189. package/lib/Source/OGC3DTilesSource.d.ts +21 -0
  190. package/lib/Source/OrientedImageSource.d.ts +48 -0
  191. package/lib/Source/Potree2Source.d.ts +157 -0
  192. package/lib/Source/PotreeSource.d.ts +69 -0
  193. package/lib/Source/Source.d.ts +122 -0
  194. package/lib/Source/TMSSource.d.ts +77 -0
  195. package/lib/Source/VectorTilesSource.d.ts +56 -0
  196. package/lib/Source/WFSSource.d.ts +110 -0
  197. package/lib/Source/WMSSource.d.ts +85 -0
  198. package/lib/Source/WMTSSource.d.ts +65 -0
  199. package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
  200. package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
  201. package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
  202. package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
  203. package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
  204. package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
  205. package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
  206. package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
  207. package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
  208. package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
  209. package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
  210. package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
  211. package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
  212. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
  213. package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
  214. package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
  215. package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
  216. package/lib/Utils/CameraUtils.d.ts +132 -0
  217. package/lib/Utils/DEMUtils.d.ts +84 -0
  218. package/lib/Utils/DEMUtils.js +2 -2
  219. package/lib/Utils/FeaturesUtils.d.ts +17 -0
  220. package/lib/Utils/Gradients.d.ts +13 -0
  221. package/lib/Utils/ThreeUtils.d.ts +14 -0
  222. package/lib/Utils/placeObjectOnGround.d.ts +28 -0
  223. package/lib/global.d.js +0 -0
  224. package/package.json +18 -15
@@ -0,0 +1,248 @@
1
+ export function readExpression(property: any, ctx: any): any;
2
+ /**
3
+ * StyleContext stores metadata of one FeatureGeometry that are needed for its style computation:
4
+ * type of feature and what is needed (fill, stroke or draw a point, etc.) as well as where to get its
5
+ * properties and its coordinates (for base_altitude).
6
+ *
7
+ * @property {number} zoom Current zoom to display the FeatureGeometry.
8
+ * @property {Object} collection The FeatureCollection to which the FeatureGeometry is attached.
9
+ * @property {Object} properties Properties of the FeatureGeometry.
10
+ * @property {string} type Geometry type of the feature. Can be `point`, `line`, or `polygon`.
11
+ * @property {StyleOptions|Function}featureStyle StyleOptions object (or a function returning one) to get style
12
+ * information at feature and FeatureGeometry level from the data parsed.
13
+ * @property {Coordinates} coordinates The coordinates (in world space) of the last vertex (x, y, z) set with
14
+ * setLocalCoordinatesFromArray().
15
+ * private properties:
16
+ * @property {Coordinates} worldCoord @private Coordinates object to store coordinates in world space.
17
+ * @property {Coordinates} localCoordinates @private Coordinates object to store coordinates in local space.
18
+ * @property {boolean} worldCoordsComputed @private Have the world coordinates already been computed
19
+ * from the local coordinates?
20
+ * @property {Feature} feature @private The itowns feature of interest.
21
+ * @property {FeatureGeometry} geometry @private The FeatureGeometry to compute the style.
22
+ */
23
+ export class StyleContext {
24
+ setZoom(zoom: any): void;
25
+ zoom: any;
26
+ setFeature(f: any): void;
27
+ setGeometry(g: any): void;
28
+ setCollection(c: any): void;
29
+ collection: any;
30
+ setLocalCoordinatesFromArray(vertices: any, offset: any): Coordinates;
31
+ get properties(): any;
32
+ get type(): any;
33
+ get featureStyle(): any;
34
+ get coordinates(): Coordinates;
35
+ #private;
36
+ }
37
+ export default Style;
38
+ import { Coordinates } from '@itowns/geographic';
39
+ /**
40
+ * A Style is a class that defines the visual appearance of {@link
41
+ * FeatureCollection} and {@link Feature}. It is taken into account when drawing
42
+ * them in textures that will be placed onto tiles.
43
+ *
44
+ * As there are five basic elements present in `Features`, there are also five
45
+ * main components in a `Style` object:
46
+ * - `fill` is for all fillings and polygons
47
+ * - `stroke` is for all lines and polygons edges
48
+ * - `point` is for all points
49
+ * - `text` contains all {@link Label} related things
50
+ * - `icon` defines the appearance of icons attached to label.
51
+ *
52
+ * Many style property can be set to functions. When that is the case, the function's
53
+ * return type must necessarily be the same as the types (other than function) of the property.
54
+ * For instance, if the `fill.pattern` property is set to a function, this function must return
55
+ * an `Image`, a `Canvas`, or `String`.
56
+ * The first parameter of functions used to set `Style` properties is always an object containing
57
+ * the properties of the features displayed with the current `Style` instance.
58
+ *
59
+ * @property {Object} fill - Polygons and fillings style.
60
+ * @property {String|Function|THREE.Color} fill.color - Defines the main color of the filling. Can be
61
+ * any [valid color
62
+ * string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
63
+ * Default is no value, indicating that no filling needs to be done.
64
+ * If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
65
+ * @property {Image|Canvas|String|Object|Function} [fill.pattern] - Defines a pattern to fill the
66
+ * surface with. It can be an `Image` to use directly, an url to fetch the pattern or an object containing
67
+ * the url of the image to fetch and the transformation to apply.
68
+ * from. See [this example] (http://www.itowns-project.org/itowns/examples/#source_file_geojson_raster)
69
+ * for how to use.
70
+ * @property {Image|String} [fill.pattern.source] - The image or the url to fetch the pattern image
71
+ * @property {Object} [fill.pattern.cropValues] - The x, y, width and height (in pixel) of the sub image to use.
72
+ * @property {THREE.Color} [fill.pattern.color] - Can be any [valid color string]
73
+ * @property {Number|Function} fill.opacity - The opacity of the color or of the
74
+ * pattern. Can be between `0.0` and `1.0`. Default is `1.0`.
75
+ * For a `GeometryLayer`, this opacity property isn't used.
76
+ * @property {Number|Function} fill.base_altitude - Only for {@link GeometryLayer}, defines altitude
77
+ * for each coordinate.
78
+ * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
79
+ * then the altitude value is set to 0.
80
+ * @property {Number|Function} [fill.extrusion_height] - Only for {@link GeometryLayer} and if user sets it.
81
+ * If defined, polygons will be extruded by the specified amount.
82
+ * @property {Object} stroke - Lines and polygons edges.
83
+ * @property {String|Function|THREE.Color} stroke.color The color of the line. Can be any [valid
84
+ * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
85
+ * Default is no value, indicating that no stroke needs to be done.
86
+ * If the `Layer` is a `GeometryLayer` you can use `THREE.Color`.
87
+ * @property {Number|Function} stroke.opacity - The opacity of the line. Can be between
88
+ * `0.0` and `1.0`. Default is `1.0`.
89
+ * For a `GeometryLayer`, this opacity property isn't used.
90
+ * @property {Number|Function} stroke.width - The width of the line. Default is `1.0`.
91
+ * @property {Number|Function} stroke.base_altitude - Only for {@link GeometryLayer}, defines altitude
92
+ * for each coordinate.
93
+ * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
94
+ * then the altitude value is set to 0.
95
+ *
96
+ * @property {Object} point - Point style.
97
+ * @property {String|Function} point.color - The color of the point. Can be any [valid
98
+ * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
99
+ * Default is no value, indicating that no point will be shown.
100
+ * @property {Number|Function} point.radius - The radius of the point, in pixel. Default
101
+ * is `2.0`.
102
+ * @property {String|Function} point.line - The color of the border of the point. Can be
103
+ * any [valid color
104
+ * string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
105
+ * Not supported for `GeometryLayer`.
106
+ * @property {Number|Function} point.width - The width of the border, in pixel. Default
107
+ * is `0.0` (no border).
108
+ * @property {Number|Function} point.opacity - The opacity of the point. Can be between
109
+ * `0.0` and `1.0`. Default is `1.0`.
110
+ * Not supported for `GeometryLayer`.
111
+ * @property {Number|Function} point.base_altitude - Only for {@link GeometryLayer}, defines altitude
112
+ * for each coordinate.
113
+ * If `base_altitude` is `undefined`, the original altitude is kept, and if it doesn't exist
114
+ * then the altitude value is set to 0.
115
+ * @property {Object} point.model - 3D model to instantiate at each point position
116
+
117
+ *
118
+ * @property {Object} text - All things {@link Label} related.
119
+ * @property {String|Function} text.field - A string representing a property key of
120
+ * a `FeatureGeometry` enclosed in brackets, that will be replaced by the value of the
121
+ * property for each geometry. For example, if each geometry contains a `name` property,
122
+ * `text.field` can be set to `{name}`. Default is no value, indicating that no
123
+ * text will be displayed.
124
+ *
125
+ * It's also possible to create more complex expressions. For example, you can combine
126
+ * text that will always be displayed (e.g. `foo`) and variable properties (e.g. `{bar}`)
127
+ * like the following: `foo {bar}`. You can also use multiple variables in one field.
128
+ * Let's say for instance that you have two properties latin name and local name of a
129
+ * place, you can write something like `{name_latin} - {name_local}` which can result
130
+ * in `Marrakesh - مراكش` for example.
131
+ * @property {String|Function} text.color - The color of the text. Can be any [valid
132
+ * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
133
+ * Default is `#000000`.
134
+ * @property {String|Number[]|Function} text.anchor - The anchor of the text relative to its
135
+ * position (see {@link Label} for the position). Can be one of the following values: `top`,
136
+ * `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
137
+ * or `bottom-right`. Default is `center`.
138
+ *
139
+ * It can also be defined as an Array of two numbers. Each number defines an offset (in
140
+ * fraction of the label width and height) between the label position and the top-left
141
+ * corner of the text. The first value is the horizontal offset, and the second is the
142
+ * vertical offset. For example, `[-0.5, -0.5]` will be equivalent to `center`.
143
+ * @property {Array|Function} text.offset - The offset of the text, depending on its
144
+ * anchor, in pixels. First value is from `left`, second is from `top`. Default
145
+ * is `[0, 0]`.
146
+ * @property {Number|Function} text.padding - The padding outside the text, in pixels.
147
+ * Default is `2`.
148
+ * @property {Number|Function} text.size - The size of the font, in pixels. Default is
149
+ * `16`.
150
+ * @property {Number|Function} text.wrap - The maximum width, in pixels, before the text
151
+ * is wrapped, because the string is too long. Default is `10`.
152
+ * @property {Number|Function} text.spacing - The spacing between the letters, in `em`.
153
+ * Default is `0`.
154
+ * @property {String|Function} text.transform - A value corresponding to the [CSS
155
+ * property
156
+ * `text-transform`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform).
157
+ * Default is `none`.
158
+ * @property {String|Function} text.justify - A value corresponding to the [CSS property
159
+ * `text-align`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
160
+ * Default is `center`.
161
+ * @property {Number|Function} text.opacity - The opacity of the text. Can be between
162
+ * `0.0` and `1.0`. Default is `1.0`.
163
+ * @property {Array|Function} text.font - A list (as an array of string) of font family
164
+ * names, prioritized in the order it is set. Default is `Open Sans Regular,
165
+ * Arial Unicode MS Regular, sans-serif`.
166
+ * @property {String|Function} text.haloColor - The color of the halo. Can be any [valid
167
+ * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
168
+ * Default is `#000000`.
169
+ * @property {Number|Function} text.haloWidth - The width of the halo, in pixels.
170
+ * Default is `0`.
171
+ * @property {Number|Function} text.haloBlur - The blur value of the halo, in pixels.
172
+ * Default is `0`.
173
+ *
174
+ * @property {Object} icon - Defines the appearance of icons attached to label.
175
+ * @property {String} icon.source - The url of the icons' image file.
176
+ * @property {String} icon.id - The id of the icons' sub-image in a vector tile data set.
177
+ * @property {String} icon.cropValues - the x, y, width and height (in pixel) of the sub image to use.
178
+ * @property {String} icon.anchor - The anchor of the icon compared to the label position.
179
+ * Can be `left`, `bottom`, `right`, `center`, `top-left`, `top-right`, `bottom-left`
180
+ * or `bottom-right`. Default is `center`.
181
+ * @property {Number} icon.size - If the icon's image is passed with `icon.source` and/or
182
+ * `icon.id`, its size when displayed on screen is multiplied by `icon.size`. Default is `1`.
183
+ * @property {String|Function} icon.color - The color of the icon. Can be any [valid
184
+ * color string](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
185
+ * It will change the color of the white pixels of the icon source image.
186
+ * @property {Number|Function} icon.opacity - The opacity of the icon. Can be between
187
+ * `0.0` and `1.0`. Default is `1.0`.
188
+ *
189
+ * @example
190
+ * const style = new itowns.Style({
191
+ * stroke: { color: 'red' },
192
+ * point: { color: 'white', line: 'red' },
193
+ * });
194
+ *
195
+ * const source = new itowns.FileSource(...);
196
+ *
197
+ * const layer = new itowns.ColorLayer('foo', {
198
+ * source: source,
199
+ * style: style,
200
+ * });
201
+ *
202
+ * view.addLayer(layer);
203
+ */
204
+ declare class Style {
205
+ /**
206
+ * @param {StyleOptions} [params={}] An object that contain any properties
207
+ * (zoom, fill, stroke, point, text or/and icon)
208
+ * and sub properties of a Style ({@link StyleOptions}).
209
+ */
210
+ constructor(params?: StyleOptions);
211
+ isStyle: boolean;
212
+ context: StyleContext;
213
+ zoom: {};
214
+ fill: {};
215
+ stroke: {};
216
+ point: {};
217
+ text: {};
218
+ icon: {};
219
+ setContext(ctx: any): void;
220
+ /**
221
+ * Applies the style.fill to a polygon of the texture canvas.
222
+ * @param {CanvasRenderingContext2D} txtrCtx The Context 2D of the texture canvas.
223
+ * @param {Path2D} polygon The current texture canvas polygon.
224
+ * @param {Number} invCtxScale The ratio to scale line width and radius circle.
225
+ * @param {Boolean} canBeFilled - true if feature.type == FEATURE_TYPES.POLYGON.
226
+ */
227
+ applyToCanvasPolygon(txtrCtx: CanvasRenderingContext2D, polygon: Path2D, invCtxScale: number, canBeFilled: boolean): void;
228
+ _applyStrokeToPolygon(txtrCtx: any, invCtxScale: any, polygon: any): void;
229
+ _applyFillToPolygon(txtrCtx: any, invCtxScale: any, polygon: any): Promise<void>;
230
+ /**
231
+ * Applies this style to a DOM element. Limited to the `text` and `icon`
232
+ * properties of this style.
233
+ *
234
+ * @param {Element} domElement - The element to set the style to.
235
+ *
236
+ * @returns {undefined|Promise<HTMLImageElement>}
237
+ * for a text label: undefined.
238
+ * for an icon: a Promise resolving with the HTMLImageElement containing the image.
239
+ */
240
+ applyToHTML(domElement: Element, ...args: any[]): undefined | Promise<HTMLImageElement>;
241
+ /**
242
+ * Gets the values corresponding to the anchor of the text. It is
243
+ * proportions, to use with a `translate()` and a `transform` property.
244
+ *
245
+ * @return {Number[]} Two percentage values, for x and y respectively.
246
+ */
247
+ getTextAnchorPosition(): number[];
248
+ }