@mapwhit/tilerenderer 0.47.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 (356) hide show
  1. package/LICENSE.txt +87 -0
  2. package/README.md +25 -0
  3. package/build/min/.dir +0 -0
  4. package/build/min/package.json +3 -0
  5. package/build/min/src/shaders/_prelude.fragment.glsl.txt +13 -0
  6. package/build/min/src/shaders/_prelude.vertex.glsl.txt +14 -0
  7. package/build/min/src/shaders/background.fragment.glsl.txt +5 -0
  8. package/build/min/src/shaders/background.vertex.glsl.txt +1 -0
  9. package/build/min/src/shaders/background_pattern.fragment.glsl.txt +5 -0
  10. package/build/min/src/shaders/background_pattern.vertex.glsl.txt +1 -0
  11. package/build/min/src/shaders/circle.fragment.glsl.txt +20 -0
  12. package/build/min/src/shaders/circle.vertex.glsl.txt +17 -0
  13. package/build/min/src/shaders/clipping_mask.fragment.glsl.txt +1 -0
  14. package/build/min/src/shaders/clipping_mask.vertex.glsl.txt +1 -0
  15. package/build/min/src/shaders/collision_box.fragment.glsl.txt +1 -0
  16. package/build/min/src/shaders/collision_box.vertex.glsl.txt +1 -0
  17. package/build/min/src/shaders/collision_circle.fragment.glsl.txt +1 -0
  18. package/build/min/src/shaders/collision_circle.vertex.glsl.txt +1 -0
  19. package/build/min/src/shaders/debug.fragment.glsl.txt +1 -0
  20. package/build/min/src/shaders/debug.vertex.glsl.txt +1 -0
  21. package/build/min/src/shaders/fill.fragment.glsl.txt +10 -0
  22. package/build/min/src/shaders/fill.vertex.glsl.txt +7 -0
  23. package/build/min/src/shaders/fill_extrusion.fragment.glsl.txt +13 -0
  24. package/build/min/src/shaders/fill_extrusion.vertex.glsl.txt +9 -0
  25. package/build/min/src/shaders/fill_extrusion_pattern.fragment.glsl.txt +15 -0
  26. package/build/min/src/shaders/fill_extrusion_pattern.vertex.glsl.txt +11 -0
  27. package/build/min/src/shaders/fill_outline.fragment.glsl.txt +10 -0
  28. package/build/min/src/shaders/fill_outline.vertex.glsl.txt +7 -0
  29. package/build/min/src/shaders/fill_outline_pattern.fragment.glsl.txt +13 -0
  30. package/build/min/src/shaders/fill_outline_pattern.vertex.glsl.txt +9 -0
  31. package/build/min/src/shaders/fill_pattern.fragment.glsl.txt +13 -0
  32. package/build/min/src/shaders/fill_pattern.vertex.glsl.txt +9 -0
  33. package/build/min/src/shaders/heatmap.fragment.glsl.txt +10 -0
  34. package/build/min/src/shaders/heatmap.vertex.glsl.txt +8 -0
  35. package/build/min/src/shaders/heatmap_texture.fragment.glsl.txt +5 -0
  36. package/build/min/src/shaders/heatmap_texture.vertex.glsl.txt +1 -0
  37. package/build/min/src/shaders/hillshade.fragment.glsl.txt +7 -0
  38. package/build/min/src/shaders/hillshade.vertex.glsl.txt +1 -0
  39. package/build/min/src/shaders/hillshade_prepare.fragment.glsl.txt +8 -0
  40. package/build/min/src/shaders/hillshade_prepare.vertex.glsl.txt +1 -0
  41. package/build/min/src/shaders/line.fragment.glsl.txt +12 -0
  42. package/build/min/src/shaders/line.vertex.glsl.txt +17 -0
  43. package/build/min/src/shaders/line_gradient.fragment.glsl.txt +10 -0
  44. package/build/min/src/shaders/line_gradient.vertex.glsl.txt +16 -0
  45. package/build/min/src/shaders/line_pattern.fragment.glsl.txt +15 -0
  46. package/build/min/src/shaders/line_pattern.vertex.glsl.txt +20 -0
  47. package/build/min/src/shaders/line_sdf.fragment.glsl.txt +17 -0
  48. package/build/min/src/shaders/line_sdf.vertex.glsl.txt +20 -0
  49. package/build/min/src/shaders/raster.fragment.glsl.txt +5 -0
  50. package/build/min/src/shaders/raster.vertex.glsl.txt +1 -0
  51. package/build/min/src/shaders/symbol_icon.fragment.glsl.txt +9 -0
  52. package/build/min/src/shaders/symbol_icon.vertex.glsl.txt +5 -0
  53. package/build/min/src/shaders/symbol_sdf.fragment.glsl.txt +19 -0
  54. package/build/min/src/shaders/symbol_sdf.vertex.glsl.txt +13 -0
  55. package/package.json +44 -0
  56. package/src/css/mapbox-gl.css +506 -0
  57. package/src/css/svg/mapboxgl-ctrl-attrib.svg +3 -0
  58. package/src/css/svg/mapboxgl-ctrl-compass.svg +4 -0
  59. package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +3 -0
  60. package/src/css/svg/mapboxgl-ctrl-geolocate-background.svg +3 -0
  61. package/src/css/svg/mapboxgl-ctrl-geolocate.svg +3 -0
  62. package/src/css/svg/mapboxgl-ctrl-logo-compact.svg +2 -0
  63. package/src/css/svg/mapboxgl-ctrl-logo.svg +1 -0
  64. package/src/css/svg/mapboxgl-ctrl-shrink.svg +3 -0
  65. package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +3 -0
  66. package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +3 -0
  67. package/src/data/array_types.js +1138 -0
  68. package/src/data/bucket/circle_attributes.js +5 -0
  69. package/src/data/bucket/circle_bucket.js +118 -0
  70. package/src/data/bucket/fill_attributes.js +5 -0
  71. package/src/data/bucket/fill_bucket.js +166 -0
  72. package/src/data/bucket/fill_extrusion_attributes.js +11 -0
  73. package/src/data/bucket/fill_extrusion_bucket.js +247 -0
  74. package/src/data/bucket/heatmap_bucket.js +12 -0
  75. package/src/data/bucket/line_attributes.js +11 -0
  76. package/src/data/bucket/line_bucket.js +625 -0
  77. package/src/data/bucket/pattern_attributes.js +9 -0
  78. package/src/data/bucket/pattern_bucket_features.js +44 -0
  79. package/src/data/bucket/symbol_attributes.js +95 -0
  80. package/src/data/bucket/symbol_bucket.js +697 -0
  81. package/src/data/bucket.js +53 -0
  82. package/src/data/dem_data.js +126 -0
  83. package/src/data/extent.js +17 -0
  84. package/src/data/feature_index.js +254 -0
  85. package/src/data/index_array_type.js +14 -0
  86. package/src/data/load_geometry.js +42 -0
  87. package/src/data/pos_attributes.js +3 -0
  88. package/src/data/program_configuration.js +782 -0
  89. package/src/data/raster_bounds_attributes.js +6 -0
  90. package/src/data/segment.js +63 -0
  91. package/src/geo/coordinate.js +78 -0
  92. package/src/geo/lng_lat.js +129 -0
  93. package/src/geo/lng_lat_bounds.js +253 -0
  94. package/src/geo/transform.js +605 -0
  95. package/src/gl/color_mode.js +21 -0
  96. package/src/gl/context.js +193 -0
  97. package/src/gl/cull_face_mode.js +22 -0
  98. package/src/gl/depth_mode.js +18 -0
  99. package/src/gl/framebuffer.js +28 -0
  100. package/src/gl/index_buffer.js +52 -0
  101. package/src/gl/stencil_mode.js +17 -0
  102. package/src/gl/types.js +0 -0
  103. package/src/gl/value.js +676 -0
  104. package/src/gl/vertex_buffer.js +101 -0
  105. package/src/index.js +50 -0
  106. package/src/render/draw_background.js +60 -0
  107. package/src/render/draw_circle.js +55 -0
  108. package/src/render/draw_collision_debug.js +45 -0
  109. package/src/render/draw_debug.js +429 -0
  110. package/src/render/draw_fill.js +143 -0
  111. package/src/render/draw_fill_extrusion.js +101 -0
  112. package/src/render/draw_heatmap.js +159 -0
  113. package/src/render/draw_hillshade.js +144 -0
  114. package/src/render/draw_line.js +99 -0
  115. package/src/render/draw_raster.js +151 -0
  116. package/src/render/draw_symbol.js +231 -0
  117. package/src/render/glyph_atlas.js +55 -0
  118. package/src/render/glyph_manager.js +145 -0
  119. package/src/render/image_atlas.js +97 -0
  120. package/src/render/image_manager.js +183 -0
  121. package/src/render/line_atlas.js +139 -0
  122. package/src/render/painter.js +483 -0
  123. package/src/render/program/background_program.js +46 -0
  124. package/src/render/program/circle_program.js +40 -0
  125. package/src/render/program/clipping_mask_program.js +11 -0
  126. package/src/render/program/collision_program.js +28 -0
  127. package/src/render/program/debug_program.js +13 -0
  128. package/src/render/program/fill_extrusion_program.js +76 -0
  129. package/src/render/program/fill_program.js +60 -0
  130. package/src/render/program/heatmap_program.js +46 -0
  131. package/src/render/program/hillshade_program.js +77 -0
  132. package/src/render/program/line_program.js +119 -0
  133. package/src/render/program/pattern.js +57 -0
  134. package/src/render/program/program_uniforms.js +46 -0
  135. package/src/render/program/raster_program.js +50 -0
  136. package/src/render/program/symbol_program.js +112 -0
  137. package/src/render/program.js +133 -0
  138. package/src/render/texture.js +88 -0
  139. package/src/render/tile_mask.js +108 -0
  140. package/src/render/uniform_binding.js +129 -0
  141. package/src/render/vertex_array_object.js +155 -0
  142. package/src/shaders/README.md +42 -0
  143. package/src/shaders/_prelude.fragment.glsl +17 -0
  144. package/src/shaders/_prelude.vertex.glsl +73 -0
  145. package/src/shaders/background.fragment.glsl +10 -0
  146. package/src/shaders/background.vertex.glsl +7 -0
  147. package/src/shaders/background_pattern.fragment.glsl +28 -0
  148. package/src/shaders/background_pattern.vertex.glsl +20 -0
  149. package/src/shaders/circle.fragment.glsl +39 -0
  150. package/src/shaders/circle.vertex.glsl +63 -0
  151. package/src/shaders/clipping_mask.fragment.glsl +3 -0
  152. package/src/shaders/clipping_mask.vertex.glsl +7 -0
  153. package/src/shaders/collision_box.fragment.glsl +21 -0
  154. package/src/shaders/collision_box.vertex.glsl +26 -0
  155. package/src/shaders/collision_circle.fragment.glsl +34 -0
  156. package/src/shaders/collision_circle.vertex.glsl +36 -0
  157. package/src/shaders/debug.fragment.glsl +5 -0
  158. package/src/shaders/debug.vertex.glsl +7 -0
  159. package/src/shaders/encode_attribute.js +19 -0
  160. package/src/shaders/fill.fragment.glsl +13 -0
  161. package/src/shaders/fill.vertex.glsl +13 -0
  162. package/src/shaders/fill_extrusion.fragment.glsl +16 -0
  163. package/src/shaders/fill_extrusion.vertex.glsl +66 -0
  164. package/src/shaders/fill_extrusion_pattern.fragment.glsl +41 -0
  165. package/src/shaders/fill_extrusion_pattern.vertex.glsl +76 -0
  166. package/src/shaders/fill_outline.fragment.glsl +17 -0
  167. package/src/shaders/fill_outline.vertex.glsl +17 -0
  168. package/src/shaders/fill_outline_pattern.fragment.glsl +43 -0
  169. package/src/shaders/fill_outline_pattern.vertex.glsl +41 -0
  170. package/src/shaders/fill_pattern.fragment.glsl +36 -0
  171. package/src/shaders/fill_pattern.vertex.glsl +36 -0
  172. package/src/shaders/heatmap.fragment.glsl +21 -0
  173. package/src/shaders/heatmap.vertex.glsl +53 -0
  174. package/src/shaders/heatmap_texture.fragment.glsl +14 -0
  175. package/src/shaders/heatmap_texture.vertex.glsl +11 -0
  176. package/src/shaders/hillshade.fragment.glsl +52 -0
  177. package/src/shaders/hillshade.vertex.glsl +11 -0
  178. package/src/shaders/hillshade_prepare.fragment.glsl +72 -0
  179. package/src/shaders/hillshade_prepare.vertex.glsl +15 -0
  180. package/src/shaders/index.js +194 -0
  181. package/src/shaders/line.fragment.glsl +28 -0
  182. package/src/shaders/line.vertex.glsl +84 -0
  183. package/src/shaders/line_gradient.fragment.glsl +34 -0
  184. package/src/shaders/line_gradient.vertex.glsl +84 -0
  185. package/src/shaders/line_pattern.fragment.glsl +69 -0
  186. package/src/shaders/line_pattern.vertex.glsl +88 -0
  187. package/src/shaders/line_sdf.fragment.glsl +44 -0
  188. package/src/shaders/line_sdf.vertex.glsl +95 -0
  189. package/src/shaders/raster.fragment.glsl +52 -0
  190. package/src/shaders/raster.vertex.glsl +21 -0
  191. package/src/shaders/symbol_icon.fragment.glsl +17 -0
  192. package/src/shaders/symbol_icon.vertex.glsl +91 -0
  193. package/src/shaders/symbol_sdf.fragment.glsl +50 -0
  194. package/src/shaders/symbol_sdf.vertex.glsl +117 -0
  195. package/src/source/geojson_source.js +267 -0
  196. package/src/source/geojson_worker_source.js +210 -0
  197. package/src/source/geojson_wrapper.js +67 -0
  198. package/src/source/image_source.js +213 -0
  199. package/src/source/load_tilejson.js +40 -0
  200. package/src/source/pixels_to_tile_units.js +17 -0
  201. package/src/source/query_features.js +198 -0
  202. package/src/source/raster_dem_tile_source.js +140 -0
  203. package/src/source/raster_dem_tile_worker_source.js +26 -0
  204. package/src/source/raster_tile_source.js +126 -0
  205. package/src/source/rtl_text_plugin.js +63 -0
  206. package/src/source/source.js +75 -0
  207. package/src/source/source_cache.js +794 -0
  208. package/src/source/source_state.js +55 -0
  209. package/src/source/tile.js +332 -0
  210. package/src/source/tile_bounds.js +40 -0
  211. package/src/source/tile_cache.js +122 -0
  212. package/src/source/tile_id.js +150 -0
  213. package/src/source/vector_tile_source.js +144 -0
  214. package/src/source/vector_tile_worker_source.js +126 -0
  215. package/src/source/worker.js +175 -0
  216. package/src/source/worker_source.js +14 -0
  217. package/src/source/worker_tile.js +199 -0
  218. package/src/style/create_style_layer.js +25 -0
  219. package/src/style/evaluation_parameters.js +45 -0
  220. package/src/style/light.js +112 -0
  221. package/src/style/load_glyph_range.js +17 -0
  222. package/src/style/load_sprite.js +26 -0
  223. package/src/style/parse_glyph_pbf.js +45 -0
  224. package/src/style/pauseable_placement.js +88 -0
  225. package/src/style/properties.js +691 -0
  226. package/src/style/query_utils.js +39 -0
  227. package/src/style/style.js +955 -0
  228. package/src/style/style_layer/background_style_layer.js +11 -0
  229. package/src/style/style_layer/background_style_layer_properties.js +25 -0
  230. package/src/style/style_layer/circle_style_layer.js +93 -0
  231. package/src/style/style_layer/circle_style_layer_properties.js +76 -0
  232. package/src/style/style_layer/fill_extrusion_style_layer.js +194 -0
  233. package/src/style/style_layer/fill_extrusion_style_layer_properties.js +56 -0
  234. package/src/style/style_layer/fill_style_layer.js +46 -0
  235. package/src/style/style_layer/fill_style_layer_properties.js +45 -0
  236. package/src/style/style_layer/heatmap_style_layer.js +51 -0
  237. package/src/style/style_layer/heatmap_style_layer_properties.js +52 -0
  238. package/src/style/style_layer/hillshade_style_layer.js +15 -0
  239. package/src/style/style_layer/hillshade_style_layer_properties.js +43 -0
  240. package/src/style/style_layer/line_style_layer.js +129 -0
  241. package/src/style/style_layer/line_style_layer_properties.js +104 -0
  242. package/src/style/style_layer/raster_style_layer.js +11 -0
  243. package/src/style/style_layer/raster_style_layer_properties.js +55 -0
  244. package/src/style/style_layer/symbol_style_layer.js +66 -0
  245. package/src/style/style_layer/symbol_style_layer_properties.js +288 -0
  246. package/src/style/style_layer.js +183 -0
  247. package/src/style/style_layer_index.js +61 -0
  248. package/src/style/zoom_history.js +36 -0
  249. package/src/style-spec/deref.js +51 -0
  250. package/src/style-spec/error/parsing_error.js +8 -0
  251. package/src/style-spec/error/validation_error.js +10 -0
  252. package/src/style-spec/expression/compound_expression.js +118 -0
  253. package/src/style-spec/expression/definitions/array.js +82 -0
  254. package/src/style-spec/expression/definitions/assertion.js +69 -0
  255. package/src/style-spec/expression/definitions/at.js +57 -0
  256. package/src/style-spec/expression/definitions/case.js +73 -0
  257. package/src/style-spec/expression/definitions/coalesce.js +68 -0
  258. package/src/style-spec/expression/definitions/coercion.js +96 -0
  259. package/src/style-spec/expression/definitions/collator.js +102 -0
  260. package/src/style-spec/expression/definitions/equals.js +93 -0
  261. package/src/style-spec/expression/definitions/index.js +407 -0
  262. package/src/style-spec/expression/definitions/interpolate.js +235 -0
  263. package/src/style-spec/expression/definitions/length.js +54 -0
  264. package/src/style-spec/expression/definitions/let.js +60 -0
  265. package/src/style-spec/expression/definitions/literal.js +64 -0
  266. package/src/style-spec/expression/definitions/match.js +142 -0
  267. package/src/style-spec/expression/definitions/step.js +116 -0
  268. package/src/style-spec/expression/definitions/var.js +38 -0
  269. package/src/style-spec/expression/evaluation_context.js +35 -0
  270. package/src/style-spec/expression/index.js +329 -0
  271. package/src/style-spec/expression/is_constant.js +63 -0
  272. package/src/style-spec/expression/parsing_context.js +213 -0
  273. package/src/style-spec/expression/parsing_error.js +9 -0
  274. package/src/style-spec/expression/runtime_error.js +12 -0
  275. package/src/style-spec/expression/scope.js +34 -0
  276. package/src/style-spec/expression/stops.js +37 -0
  277. package/src/style-spec/expression/types.js +77 -0
  278. package/src/style-spec/expression/values.js +126 -0
  279. package/src/style-spec/feature_filter/README.md +55 -0
  280. package/src/style-spec/feature_filter/index.js +158 -0
  281. package/src/style-spec/function/convert.js +256 -0
  282. package/src/style-spec/function/index.js +299 -0
  283. package/src/style-spec/group_by_layout.js +68 -0
  284. package/src/style-spec/reference/v8.json +5356 -0
  285. package/src/style-spec/util/color.js +73 -0
  286. package/src/style-spec/util/color_spaces.js +128 -0
  287. package/src/style-spec/util/eval_support.js +8 -0
  288. package/src/style-spec/util/get_type.js +18 -0
  289. package/src/style-spec/util/interpolate.js +21 -0
  290. package/src/style-spec/util/properties.js +17 -0
  291. package/src/style-spec/util/ref_properties.js +1 -0
  292. package/src/style-spec/util/result.js +19 -0
  293. package/src/symbol/anchor.js +21 -0
  294. package/src/symbol/check_max_angle.js +75 -0
  295. package/src/symbol/clip_line.js +73 -0
  296. package/src/symbol/collision_feature.js +230 -0
  297. package/src/symbol/collision_index.js +379 -0
  298. package/src/symbol/cross_tile_symbol_index.js +270 -0
  299. package/src/symbol/get_anchors.js +177 -0
  300. package/src/symbol/grid_index.js +318 -0
  301. package/src/symbol/mergelines.js +75 -0
  302. package/src/symbol/opacity_state.js +21 -0
  303. package/src/symbol/placement.js +563 -0
  304. package/src/symbol/projection.js +601 -0
  305. package/src/symbol/quads.js +173 -0
  306. package/src/symbol/shaping.js +347 -0
  307. package/src/symbol/symbol_layout.js +519 -0
  308. package/src/symbol/symbol_size.js +110 -0
  309. package/src/symbol/transform_text.js +16 -0
  310. package/src/ui/anchor.js +24 -0
  311. package/src/ui/bind_handlers.js +199 -0
  312. package/src/ui/camera.js +954 -0
  313. package/src/ui/events.js +210 -0
  314. package/src/ui/handler/box_zoom.js +151 -0
  315. package/src/ui/handler/dblclick_zoom.js +91 -0
  316. package/src/ui/handler/drag_pan.js +285 -0
  317. package/src/ui/handler/drag_rotate.js +290 -0
  318. package/src/ui/handler/frame.js +28 -0
  319. package/src/ui/handler/inertia.js +45 -0
  320. package/src/ui/handler/keyboard.js +148 -0
  321. package/src/ui/handler/scroll_zoom.js +284 -0
  322. package/src/ui/handler/touch_zoom_rotate.js +263 -0
  323. package/src/ui/map.js +1645 -0
  324. package/src/util/actor.js +104 -0
  325. package/src/util/async.js +23 -0
  326. package/src/util/browser.js +61 -0
  327. package/src/util/callback.js +26 -0
  328. package/src/util/classify_rings.js +43 -0
  329. package/src/util/color_ramp.js +24 -0
  330. package/src/util/config.js +24 -0
  331. package/src/util/dictionary_coder.js +25 -0
  332. package/src/util/dispatcher.js +68 -0
  333. package/src/util/dom.js +102 -0
  334. package/src/util/evented.js +182 -0
  335. package/src/util/find_pole_of_inaccessibility.js +129 -0
  336. package/src/util/global_worker_pool.js +15 -0
  337. package/src/util/image.js +124 -0
  338. package/src/util/interpolate.js +5 -0
  339. package/src/util/intersection_tests.js +207 -0
  340. package/src/util/is_char_in_unicode_block.js +287 -0
  341. package/src/util/loader/image.js +32 -0
  342. package/src/util/object.js +178 -0
  343. package/src/util/script_detection.js +337 -0
  344. package/src/util/struct_array.js +197 -0
  345. package/src/util/task_queue.js +57 -0
  346. package/src/util/throttle.js +26 -0
  347. package/src/util/tile_cover.js +114 -0
  348. package/src/util/token.js +13 -0
  349. package/src/util/unique_id.js +12 -0
  350. package/src/util/util.js +192 -0
  351. package/src/util/vectortile_to_geojson.js +44 -0
  352. package/src/util/verticalize_punctuation.js +112 -0
  353. package/src/util/warn.js +21 -0
  354. package/src/util/web_worker.js +5 -0
  355. package/src/util/web_worker_transfer.js +228 -0
  356. package/src/util/worker_pool.js +41 -0
@@ -0,0 +1,691 @@
1
+ const assert = require('assert');
2
+
3
+ const { clone } = require('../util/object');
4
+ const { easeCubicInOut } = require('../util/util');
5
+ const interpolate = require('../style-spec/util/interpolate');
6
+ const { normalizePropertyExpression } = require('../style-spec/expression');
7
+ const { register } = require('../util/web_worker_transfer');
8
+ const EvaluationParameters = require('./evaluation_parameters');
9
+
10
+ /**
11
+ * Implements a number of classes that define state and behavior for paint and layout properties, most
12
+ * importantly their respective evaluation chains:
13
+ *
14
+ * Transitionable paint property value
15
+ * → Transitioning paint property value
16
+ * → Possibly evaluated paint property value
17
+ * → Fully evaluated paint property value
18
+ *
19
+ * Layout property value
20
+ * → Possibly evaluated layout property value
21
+ * → Fully evaluated layout property value
22
+ *
23
+ * @module
24
+ * @private
25
+ */
26
+
27
+ /**
28
+ * Implementations of the `Property` interface:
29
+ *
30
+ * * Hold metadata about a property that's independent of any specific value: stuff like the type of the value,
31
+ * the default value, etc. This comes from the style specification JSON.
32
+ * * Define behavior that needs to be polymorphic across different properties: "possibly evaluating"
33
+ * an input value (see below), and interpolating between two possibly-evaluted values.
34
+ *
35
+ * The type `T` is the fully-evaluated value type (e.g. `number`, `string`, `Color`).
36
+ * The type `R` is the intermediate "possibly evaluated" value type. See below.
37
+ *
38
+ * There are two main implementations of the interface -- one for properties that allow data-driven values,
39
+ * and one for properties that don't. There are a few "special case" implementations as well: one for properties
40
+ * which cross-fade between two values rather than interpolating, one for `heatmap-color` and `line-gradient`,
41
+ * and one for `light-position`.
42
+ *
43
+ * @private
44
+ */
45
+
46
+ /**
47
+ * `PropertyValue` represents the value part of a property key-value unit. It's used to represent both
48
+ * paint and layout property values, and regardless of whether or not their property supports data-driven
49
+ * expressions.
50
+ *
51
+ * `PropertyValue` stores the raw input value as seen in a style or a runtime styling API call, i.e. one of the
52
+ * following:
53
+ *
54
+ * * A constant value of the type appropriate for the property
55
+ * * A function which produces a value of that type (but functions are quasi-deprecated in favor of expressions)
56
+ * * An expression which produces a value of that type
57
+ * * "undefined"/"not present", in which case the property is assumed to take on its default value.
58
+ *
59
+ * In addition to storing the original input value, `PropertyValue` also stores a normalized representation,
60
+ * effectively treating functions as if they are expressions, and constant or default values as if they are
61
+ * (constant) expressions.
62
+ *
63
+ * @private
64
+ */
65
+ class PropertyValue {
66
+ constructor(property, value) {
67
+ this.property = property;
68
+ this.value = value;
69
+ this.expression = normalizePropertyExpression(
70
+ value === undefined ? property.specification.default : value,
71
+ property.specification
72
+ );
73
+ }
74
+
75
+ isDataDriven() {
76
+ return this.expression.kind === 'source' || this.expression.kind === 'composite';
77
+ }
78
+
79
+ possiblyEvaluate(parameters) {
80
+ return this.property.possiblyEvaluate(this, parameters);
81
+ }
82
+ }
83
+
84
+ // ------- Transitionable -------
85
+
86
+ /**
87
+ * Paint properties are _transitionable_: they can change in a fluid manner, interpolating or cross-fading between
88
+ * old and new value. The duration of the transition, and the delay before it begins, is configurable.
89
+ *
90
+ * `TransitionablePropertyValue` is a compositional class that stores both the property value and that transition
91
+ * configuration.
92
+ *
93
+ * A `TransitionablePropertyValue` can calculate the next step in the evaluation chain for paint property values:
94
+ * `TransitioningPropertyValue`.
95
+ *
96
+ * @private
97
+ */
98
+ class TransitionablePropertyValue {
99
+ constructor(property) {
100
+ this.property = property;
101
+ this.value = new PropertyValue(property, undefined);
102
+ }
103
+
104
+ transitioned(parameters, prior) {
105
+ return new TransitioningPropertyValue(
106
+ this.property,
107
+ this.value,
108
+ prior,
109
+ Object.assign({}, parameters.transition, this.transition),
110
+ parameters.now
111
+ );
112
+ }
113
+
114
+ untransitioned() {
115
+ return new TransitioningPropertyValue(this.property, this.value, null, {}, 0);
116
+ }
117
+ }
118
+
119
+ /**
120
+ * A helper type: given an object type `Properties` whose values are each of type `Property<T, R>`, it calculates
121
+ * an object type with the same keys and values of type `TransitionablePropertyValue<T, R>`.
122
+ *
123
+ * @private
124
+ */
125
+
126
+ /**
127
+ * `Transitionable` stores a map of all (property name, `TransitionablePropertyValue`) pairs for paint properties of a
128
+ * given layer type. It can calculate the `TransitioningPropertyValue`s for all of them at once, producing a
129
+ * `Transitioning` instance for the same set of properties.
130
+ *
131
+ * @private
132
+ */
133
+ class Transitionable {
134
+ constructor(properties) {
135
+ this._properties = properties;
136
+ this._values = Object.create(properties.defaultTransitionablePropertyValues);
137
+ }
138
+
139
+ getValue(name) {
140
+ return clone(this._values[name].value.value);
141
+ }
142
+
143
+ setValue(name, value) {
144
+ if (!this._values.hasOwnProperty(name)) {
145
+ this._values[name] = new TransitionablePropertyValue(this._values[name].property);
146
+ }
147
+ // Note that we do not _remove_ an own property in the case where a value is being reset
148
+ // to the default: the transition might still be non-default.
149
+ this._values[name].value = new PropertyValue(
150
+ this._values[name].property,
151
+ value === null ? undefined : clone(value)
152
+ );
153
+ }
154
+
155
+ getTransition(name) {
156
+ return clone(this._values[name].transition);
157
+ }
158
+
159
+ setTransition(name, value) {
160
+ if (!this._values.hasOwnProperty(name)) {
161
+ this._values[name] = new TransitionablePropertyValue(this._values[name].property);
162
+ }
163
+ this._values[name].transition = clone(value) || undefined;
164
+ }
165
+
166
+ serialize() {
167
+ const result = {};
168
+ for (const property of Object.keys(this._values)) {
169
+ const value = this.getValue(property);
170
+ if (value !== undefined) {
171
+ result[property] = value;
172
+ }
173
+
174
+ const transition = this.getTransition(property);
175
+ if (transition !== undefined) {
176
+ result[`${property}-transition`] = transition;
177
+ }
178
+ }
179
+ return result;
180
+ }
181
+
182
+ transitioned(parameters, prior) {
183
+ const result = new Transitioning(this._properties);
184
+ for (const property of Object.keys(this._values)) {
185
+ result._values[property] = this._values[property].transitioned(parameters, prior._values[property]);
186
+ }
187
+ return result;
188
+ }
189
+
190
+ untransitioned() {
191
+ const result = new Transitioning(this._properties);
192
+ for (const property of Object.keys(this._values)) {
193
+ result._values[property] = this._values[property].untransitioned();
194
+ }
195
+ return result;
196
+ }
197
+ }
198
+
199
+ // ------- Transitioning -------
200
+
201
+ /**
202
+ * `TransitioningPropertyValue` implements the first of two intermediate steps in the evaluation chain of a paint
203
+ * property value. In this step, transitions between old and new values are handled: as long as the transition is in
204
+ * progress, `TransitioningPropertyValue` maintains a reference to the prior value, and interpolates between it and
205
+ * the new value based on the current time and the configured transition duration and delay. The product is the next
206
+ * step in the evaluation chain: the "possibly evaluated" result type `R`. See below for more on this concept.
207
+ *
208
+ * @private
209
+ */
210
+ class TransitioningPropertyValue {
211
+ constructor(property, value, prior, transition, now) {
212
+ this.property = property;
213
+ this.value = value;
214
+ this.begin = now + transition.delay || 0;
215
+ this.end = this.begin + transition.duration || 0;
216
+ if (property.specification.transition && (transition.delay || transition.duration)) {
217
+ this.prior = prior;
218
+ }
219
+ }
220
+
221
+ possiblyEvaluate(parameters) {
222
+ const now = parameters.now || 0;
223
+ const finalValue = this.value.possiblyEvaluate(parameters);
224
+ const prior = this.prior;
225
+ if (!prior) {
226
+ // No prior value.
227
+ return finalValue;
228
+ }
229
+ if (now > this.end) {
230
+ // Transition from prior value is now complete.
231
+ this.prior = null;
232
+ return finalValue;
233
+ }
234
+ if (this.value.isDataDriven()) {
235
+ // Transitions to data-driven properties are not supported.
236
+ // We snap immediately to the data-driven value so that, when we perform layout,
237
+ // we see the data-driven function and can use it to populate vertex buffers.
238
+ this.prior = null;
239
+ return finalValue;
240
+ }
241
+ if (now < this.begin) {
242
+ // Transition hasn't started yet.
243
+ return prior.possiblyEvaluate(parameters);
244
+ }
245
+ // Interpolate between recursively-calculated prior value and final.
246
+ const t = (now - this.begin) / (this.end - this.begin);
247
+ return this.property.interpolate(prior.possiblyEvaluate(parameters), finalValue, easeCubicInOut(t));
248
+ }
249
+ }
250
+
251
+ /**
252
+ * A helper type: given an object type `Properties` whose values are each of type `Property<T, R>`, it calculates
253
+ * an object type with the same keys and values of type `TransitioningPropertyValue<T, R>`.
254
+ *
255
+ * @private
256
+ */
257
+
258
+ /**
259
+ * `Transitioning` stores a map of all (property name, `TransitioningPropertyValue`) pairs for paint properties of a
260
+ * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a
261
+ * `PossiblyEvaluated` instance for the same set of properties.
262
+ *
263
+ * @private
264
+ */
265
+ class Transitioning {
266
+ constructor(properties) {
267
+ this._properties = properties;
268
+ this._values = Object.create(properties.defaultTransitioningPropertyValues);
269
+ }
270
+
271
+ possiblyEvaluate(parameters) {
272
+ const result = new PossiblyEvaluated(this._properties);
273
+ for (const property of Object.keys(this._values)) {
274
+ result._values[property] = this._values[property].possiblyEvaluate(parameters);
275
+ }
276
+ return result;
277
+ }
278
+
279
+ hasTransition() {
280
+ for (const property of Object.keys(this._values)) {
281
+ if (this._values[property].prior) {
282
+ return true;
283
+ }
284
+ }
285
+ return false;
286
+ }
287
+ }
288
+
289
+ // ------- Layout -------
290
+
291
+ /**
292
+ * A helper type: given an object type `Properties` whose values are each of type `Property<T, R>`, it calculates
293
+ * an object type with the same keys and values of type `PropertyValue<T, R>`.
294
+ *
295
+ * @private
296
+ */
297
+
298
+ /**
299
+ * Because layout properties are not transitionable, they have a simpler representation and evaluation chain than
300
+ * paint properties: `PropertyValue`s are possibly evaluated, producing possibly evaluated values, which are then
301
+ * fully evaluated.
302
+ *
303
+ * `Layout` stores a map of all (property name, `PropertyValue`) pairs for layout properties of a
304
+ * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a
305
+ * `PossiblyEvaluated` instance for the same set of properties.
306
+ *
307
+ * @private
308
+ */
309
+ class Layout {
310
+ constructor(properties) {
311
+ this._properties = properties;
312
+ this._values = Object.create(properties.defaultPropertyValues);
313
+ }
314
+
315
+ getValue(name) {
316
+ return clone(this._values[name].value);
317
+ }
318
+
319
+ setValue(name, value) {
320
+ this._values[name] = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value));
321
+ }
322
+
323
+ serialize() {
324
+ const result = {};
325
+ for (const property of Object.keys(this._values)) {
326
+ const value = this.getValue(property);
327
+ if (value !== undefined) {
328
+ result[property] = value;
329
+ }
330
+ }
331
+ return result;
332
+ }
333
+
334
+ possiblyEvaluate(parameters) {
335
+ const result = new PossiblyEvaluated(this._properties);
336
+ for (const property of Object.keys(this._values)) {
337
+ result._values[property] = this._values[property].possiblyEvaluate(parameters);
338
+ }
339
+ return result;
340
+ }
341
+ }
342
+
343
+ // ------- PossiblyEvaluated -------
344
+
345
+ /**
346
+ * "Possibly evaluated value" is an intermediate stage in the evaluation chain for both paint and layout property
347
+ * values. The purpose of this stage is to optimize away unnecessary recalculations for data-driven properties. Code
348
+ * which uses data-driven property values must assume that the value is dependent on feature data, and request that it
349
+ * be evaluated for each feature. But when that property value is in fact a constant or camera function, the calculation
350
+ * will not actually depend on the feature, and we can benefit from returning the prior result of having done the
351
+ * evaluation once, ahead of time, in an intermediate step whose inputs are just the value and "global" parameters
352
+ * such as current zoom level.
353
+ *
354
+ * `PossiblyEvaluatedValue` represents the three possible outcomes of this step: if the input value was a constant or
355
+ * camera expression, then the "possibly evaluated" result is a constant value. Otherwise, the input value was either
356
+ * a source or composite expression, and we must defer final evaluation until supplied a feature. We separate
357
+ * the source and composite cases because they are handled differently when generating GL attributes, buffers, and
358
+ * uniforms.
359
+ *
360
+ * Note that `PossiblyEvaluatedValue` (and `PossiblyEvaluatedPropertyValue`, below) are _not_ used for properties that
361
+ * do not allow data-driven values. For such properties, we know that the "possibly evaluated" result is always a constant
362
+ * scalar value. See below.
363
+ *
364
+ * @private
365
+ */
366
+
367
+ /**
368
+ * `PossiblyEvaluatedPropertyValue` is used for data-driven paint and layout property values. It holds a
369
+ * `PossiblyEvaluatedValue` and the `GlobalProperties` that were used to generate it. You're not allowed to supply
370
+ * a different set of `GlobalProperties` when performing the final evaluation because they would be ignored in the
371
+ * case where the input value was a constant or camera function.
372
+ *
373
+ * @private
374
+ */
375
+ class PossiblyEvaluatedPropertyValue {
376
+ constructor(property, value, parameters) {
377
+ this.property = property;
378
+ this.value = value;
379
+ this.parameters = parameters;
380
+ }
381
+
382
+ isConstant() {
383
+ return this.value.kind === 'constant';
384
+ }
385
+
386
+ constantOr(value) {
387
+ if (this.value.kind === 'constant') {
388
+ return this.value.value;
389
+ }
390
+ return value;
391
+ }
392
+
393
+ evaluate(feature, featureState) {
394
+ return this.property.evaluate(this.value, this.parameters, feature, featureState);
395
+ }
396
+ }
397
+
398
+ /**
399
+ * A helper type: given an object type `Properties` whose values are each of type `Property<T, R>`, it calculates
400
+ * an object type with the same keys, and values of type `R`.
401
+ *
402
+ * For properties that don't allow data-driven values, `R` is a scalar type such as `number`, `string`, or `Color`.
403
+ * For data-driven properties, it is `PossiblyEvaluatedPropertyValue`. Critically, the type definitions are set up
404
+ * in a way that allows flow to know which of these two cases applies for any given property name, and if you attempt
405
+ * to use a `PossiblyEvaluatedPropertyValue` as if it was a scalar, or vice versa, you will get a type error. (However,
406
+ * there's at least one case in which flow fails to produce a type error that you should be aware of: in a context such
407
+ * as `layer.paint.get('foo-opacity') === 0`, if `foo-opacity` is data-driven, than the left-hand side is of type
408
+ * `PossiblyEvaluatedPropertyValue<number>`, but flow will not complain about comparing this to a number using `===`.
409
+ * See https://github.com/facebook/flow/issues/2359.)
410
+ *
411
+ * There's also a third, special case possiblity for `R`: for cross-faded properties, it's `?CrossFaded<T>`.
412
+ *
413
+ * @private
414
+ */
415
+
416
+ /**
417
+ * `PossiblyEvaluated` stores a map of all (property name, `R`) pairs for paint or layout properties of a
418
+ * given layer type.
419
+ * @private
420
+ */
421
+ class PossiblyEvaluated {
422
+ constructor(properties) {
423
+ this._properties = properties;
424
+ this._values = Object.create(properties.defaultPossiblyEvaluatedValues);
425
+ }
426
+
427
+ get(name) {
428
+ return this._values[name];
429
+ }
430
+ }
431
+
432
+ /**
433
+ * An implementation of `Property` for properties that do not permit data-driven (source or composite) expressions.
434
+ * This restriction allows us to declare statically that the result of possibly evaluating this kind of property
435
+ * is in fact always the scalar type `T`, and can be used without further evaluating the value on a per-feature basis.
436
+ *
437
+ * @private
438
+ */
439
+ class DataConstantProperty {
440
+ constructor(specification) {
441
+ this.specification = specification;
442
+ this.specification['property-type'] ??= 'data-constant';
443
+ }
444
+
445
+ possiblyEvaluate(value, parameters) {
446
+ assert(!value.isDataDriven());
447
+ return value.expression.evaluate(parameters);
448
+ }
449
+
450
+ interpolate(a, b, t) {
451
+ const interp = interpolate[this.specification.type];
452
+ if (interp) {
453
+ return interp(a, b, t);
454
+ }
455
+ return a;
456
+ }
457
+ }
458
+
459
+ /**
460
+ * An implementation of `Property` for properties that permit data-driven (source or composite) expressions.
461
+ * The result of possibly evaluating this kind of property is `PossiblyEvaluatedPropertyValue<T>`; obtaining
462
+ * a scalar value `T` requires further evaluation on a per-feature basis.
463
+ *
464
+ * @private
465
+ */
466
+ class DataDrivenProperty {
467
+ constructor(specification) {
468
+ this.specification = specification;
469
+ this.specification['property-type'] ??= 'data-driven';
470
+ }
471
+
472
+ possiblyEvaluate(value, parameters) {
473
+ if (value.expression.kind === 'constant' || value.expression.kind === 'camera') {
474
+ return new PossiblyEvaluatedPropertyValue(
475
+ this,
476
+ { kind: 'constant', value: value.expression.evaluate(parameters) },
477
+ parameters
478
+ );
479
+ }
480
+ return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);
481
+ }
482
+
483
+ interpolate(a, b, t) {
484
+ // If either possibly-evaluated value is non-constant, give up: we aren't able to interpolate data-driven values.
485
+ if (a.value.kind !== 'constant' || b.value.kind !== 'constant') {
486
+ return a;
487
+ }
488
+
489
+ // Special case hack solely for fill-outline-color. The undefined value is subsequently handled in
490
+ // FillStyleLayer#recalculate, which sets fill-outline-color to the fill-color value if the former
491
+ // is a PossiblyEvaluatedPropertyValue containing a constant undefined value. In addition to the
492
+ // return value here, the other source of a PossiblyEvaluatedPropertyValue containing a constant
493
+ // undefined value is the "default value" for fill-outline-color held in
494
+ // `Properties#defaultPossiblyEvaluatedValues`, which serves as the prototype of
495
+ // `PossiblyEvaluated#_values`.
496
+ if (a.value.value === undefined || b.value.value === undefined) {
497
+ return new PossiblyEvaluatedPropertyValue(this, { kind: 'constant', value: undefined }, a.parameters);
498
+ }
499
+
500
+ const interp = interpolate[this.specification.type];
501
+ if (interp) {
502
+ return new PossiblyEvaluatedPropertyValue(
503
+ this,
504
+ { kind: 'constant', value: interp(a.value.value, b.value.value, t) },
505
+ a.parameters
506
+ );
507
+ }
508
+ return a;
509
+ }
510
+
511
+ evaluate(value, parameters, feature, featureState) {
512
+ if (value.kind === 'constant') {
513
+ return value.value;
514
+ }
515
+ return value.evaluate(parameters, feature, featureState);
516
+ }
517
+ }
518
+
519
+ /**
520
+ * An implementation of `Property` for data driven `line-pattern` which are transitioned by cross-fading
521
+ * rather than interpolation.
522
+ *
523
+ * @private
524
+ */
525
+
526
+ class CrossFadedDataDrivenProperty extends DataDrivenProperty {
527
+ constructor(specification) {
528
+ specification['property-type'] ??= 'cross-faded-data-driven';
529
+ super(specification);
530
+ }
531
+
532
+ possiblyEvaluate(value, parameters) {
533
+ if (value.value === undefined) {
534
+ return new PossiblyEvaluatedPropertyValue(this, { kind: 'constant', value: undefined }, parameters);
535
+ }
536
+ if (value.expression.kind === 'constant') {
537
+ const constantValue = value.expression.evaluate(parameters);
538
+ const constant = this._calculate(constantValue, constantValue, constantValue, parameters);
539
+ return new PossiblyEvaluatedPropertyValue(this, { kind: 'constant', value: constant }, parameters);
540
+ }
541
+ if (value.expression.kind === 'camera') {
542
+ const cameraVal = this._calculate(
543
+ value.expression.evaluate({ zoom: parameters.zoom - 1.0 }),
544
+ value.expression.evaluate({ zoom: parameters.zoom }),
545
+ value.expression.evaluate({ zoom: parameters.zoom + 1.0 }),
546
+ parameters
547
+ );
548
+ return new PossiblyEvaluatedPropertyValue(this, { kind: 'constant', value: cameraVal }, parameters);
549
+ }
550
+ // source or composite expression
551
+ return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);
552
+ }
553
+
554
+ evaluate(value, globals, feature, featureState) {
555
+ if (value.kind === 'source') {
556
+ const constant = value.evaluate(globals, feature, featureState);
557
+ return this._calculate(constant, constant, constant, globals);
558
+ }
559
+ if (value.kind === 'composite') {
560
+ return this._calculate(
561
+ value.evaluate({ zoom: Math.floor(globals.zoom) - 1.0 }, feature, featureState),
562
+ value.evaluate({ zoom: Math.floor(globals.zoom) }, feature, featureState),
563
+ value.evaluate({ zoom: Math.floor(globals.zoom) + 1.0 }, feature, featureState),
564
+ globals
565
+ );
566
+ }
567
+ return value.value;
568
+ }
569
+
570
+ _calculate(min, mid, max, parameters) {
571
+ const z = parameters.zoom;
572
+ return z > parameters.zoomHistory.lastIntegerZoom ? { from: min, to: mid } : { from: max, to: mid };
573
+ }
574
+
575
+ interpolate(a) {
576
+ return a;
577
+ }
578
+ }
579
+
580
+ /**
581
+ * An implementation of `Property` for `*-pattern` and `line-dasharray`, which are transitioned by cross-fading
582
+ * rather than interpolation.
583
+ *
584
+ * @private
585
+ */
586
+ class CrossFadedProperty {
587
+ constructor(specification) {
588
+ this.specification = specification;
589
+ this.specification['property-type'] ??= 'cross-faded';
590
+ }
591
+
592
+ possiblyEvaluate(value, parameters) {
593
+ if (value.value === undefined) {
594
+ return undefined;
595
+ }
596
+ if (value.expression.kind === 'constant') {
597
+ const constant = value.expression.evaluate(parameters);
598
+ return this._calculate(constant, constant, constant, parameters);
599
+ }
600
+ assert(!value.isDataDriven());
601
+ return this._calculate(
602
+ value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom - 1.0), parameters)),
603
+ value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom), parameters)),
604
+ value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom + 1.0), parameters)),
605
+ parameters
606
+ );
607
+ }
608
+
609
+ _calculate(min, mid, max, parameters) {
610
+ const z = parameters.zoom;
611
+ return z > parameters.zoomHistory.lastIntegerZoom ? { from: min, to: mid } : { from: max, to: mid };
612
+ }
613
+
614
+ interpolate(a) {
615
+ return a;
616
+ }
617
+ }
618
+
619
+ /**
620
+ * An implementation of `Property` for `heatmap-color` and `line-gradient`. Interpolation is a no-op, and
621
+ * evaluation returns a boolean value in order to indicate its presence, but the real
622
+ * evaluation happens in StyleLayer classes.
623
+ *
624
+ * @private
625
+ */
626
+
627
+ class ColorRampProperty {
628
+ constructor(specification) {
629
+ this.specification = specification;
630
+ this.specification['property-type'] ??= 'color-ramp';
631
+ }
632
+
633
+ possiblyEvaluate(value, parameters) {
634
+ return !!value.expression.evaluate(parameters);
635
+ }
636
+
637
+ interpolate() {
638
+ return false;
639
+ }
640
+ }
641
+
642
+ /**
643
+ * `Properties` holds objects containing default values for the layout or paint property set of a given
644
+ * layer type. These objects are immutable, and they are used as the prototypes for the `_values` members of
645
+ * `Transitionable`, `Transitioning`, `Layout`, and `PossiblyEvaluated`. This allows these classes to avoid
646
+ * doing work in the common case where a property has no explicit value set and should be considered to take
647
+ * on the default value: using `for (const property of Object.keys(this._values))`, they can iterate over
648
+ * only the _own_ properties of `_values`, skipping repeated calculation of transitions and possible/final
649
+ * evaluations for defaults, the result of which will always be the same.
650
+ *
651
+ * @private
652
+ */
653
+ class Properties {
654
+ constructor(properties) {
655
+ this.properties = properties;
656
+ this.defaultPropertyValues = {};
657
+ this.defaultTransitionablePropertyValues = {};
658
+ this.defaultTransitioningPropertyValues = {};
659
+ this.defaultPossiblyEvaluatedValues = {};
660
+
661
+ for (const property in properties) {
662
+ const prop = properties[property];
663
+ const defaultPropertyValue = (this.defaultPropertyValues[property] = new PropertyValue(prop, undefined));
664
+ const defaultTransitionablePropertyValue = (this.defaultTransitionablePropertyValues[property] =
665
+ new TransitionablePropertyValue(prop));
666
+ this.defaultTransitioningPropertyValues[property] = defaultTransitionablePropertyValue.untransitioned();
667
+ this.defaultPossiblyEvaluatedValues[property] = defaultPropertyValue.possiblyEvaluate({});
668
+ }
669
+ }
670
+ }
671
+
672
+ register('DataDrivenProperty', DataDrivenProperty);
673
+ register('DataConstantProperty', DataConstantProperty);
674
+ register('CrossFadedDataDrivenProperty', CrossFadedDataDrivenProperty);
675
+ register('CrossFadedProperty', CrossFadedProperty);
676
+ register('ColorRampProperty', ColorRampProperty);
677
+
678
+ module.exports = {
679
+ PropertyValue,
680
+ Transitionable,
681
+ Transitioning,
682
+ Layout,
683
+ PossiblyEvaluatedPropertyValue,
684
+ PossiblyEvaluated,
685
+ DataConstantProperty,
686
+ DataDrivenProperty,
687
+ CrossFadedDataDrivenProperty,
688
+ CrossFadedProperty,
689
+ ColorRampProperty,
690
+ Properties
691
+ };