maplibre-gl 3.0.0-pre.1 → 3.0.0-pre.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +5 -3
  2. package/build/generate-debug-index-file.ts +1 -0
  3. package/build/generate-style-spec.ts +13 -13
  4. package/build/rollup_plugins.ts +2 -4
  5. package/dist/maplibre-gl-csp-worker.js +1 -1
  6. package/dist/maplibre-gl-csp.js +1 -1
  7. package/dist/maplibre-gl-dev.js +3964 -684
  8. package/dist/maplibre-gl.css +1 -1
  9. package/dist/maplibre-gl.d.ts +332 -319
  10. package/dist/maplibre-gl.js +4 -4
  11. package/dist/style-spec/index.d.ts +78 -78
  12. package/package.json +74 -69
  13. package/src/css/maplibre-gl.css +5 -0
  14. package/src/data/bucket/symbol_bucket.test.ts +1 -1
  15. package/src/data/bucket/symbol_bucket.ts +2 -0
  16. package/src/geo/transform.test.ts +12 -0
  17. package/src/geo/transform.ts +5 -7
  18. package/src/gl/render_pool.test.ts +2 -2
  19. package/src/gl/state.test.ts +1 -1
  20. package/src/gl/vertex_buffer.test.ts +3 -3
  21. package/src/render/draw_fill.test.ts +137 -0
  22. package/src/render/draw_fill.ts +8 -11
  23. package/src/render/draw_fill_extrusion.ts +7 -9
  24. package/src/render/draw_symbol.test.ts +66 -2
  25. package/src/render/draw_symbol.ts +2 -1
  26. package/src/render/render_to_texture.test.ts +1 -1
  27. package/src/render/terrain.test.ts +4 -4
  28. package/src/render/update_pattern_positions_in_program.ts +46 -0
  29. package/src/source/image_source.test.ts +26 -0
  30. package/src/source/image_source.ts +19 -2
  31. package/src/source/raster_dem_tile_worker_source.ts +1 -1
  32. package/src/source/terrain_source_cache.test.ts +1 -1
  33. package/src/source/vector_tile_source.test.ts +1 -1
  34. package/src/style/style.ts +3 -3
  35. package/src/style-spec/expression/expression.test.ts +1 -1
  36. package/src/style-spec/feature_filter/feature_filter.test.ts +1 -0
  37. package/src/style-spec/migrate.test.ts +1 -1
  38. package/src/style-spec/reference/v8.json +2 -2
  39. package/src/style-spec/types.g.ts +13 -13
  40. package/src/style-spec/validate/validate_terrain.test.ts +1 -1
  41. package/src/style-spec/validate/validate_terrain.ts +1 -1
  42. package/src/style-spec/visit.ts +1 -1
  43. package/src/symbol/cross_tile_symbol_index.test.ts +23 -1
  44. package/src/symbol/cross_tile_symbol_index.ts +98 -45
  45. package/src/symbol/placement.ts +9 -2
  46. package/src/ui/control/attribution_control.ts +2 -2
  47. package/src/ui/control/navigation_control.test.ts +240 -0
  48. package/src/ui/control/navigation_control.ts +55 -23
  49. package/src/ui/handler/drag_handler.ts +166 -0
  50. package/src/ui/handler/drag_move_state_manager.ts +115 -0
  51. package/src/ui/handler/mouse.ts +70 -154
  52. package/src/ui/handler/mouse_handler_interface.test.ts +118 -0
  53. package/src/ui/handler/mouse_rotate.test.ts +1 -1
  54. package/src/ui/handler/one_finger_touch_drag.ts +45 -0
  55. package/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts +84 -0
  56. package/src/ui/handler/shim/drag_rotate.ts +1 -1
  57. package/src/ui/handler/shim/{touch_zoom_rotate.ts → two_fingers_touch.ts} +6 -6
  58. package/src/ui/handler/{touch_zoom_rotate.test.ts → two_fingers_touch.test.ts} +7 -7
  59. package/src/ui/handler/{touch_zoom_rotate.ts → two_fingers_touch.ts} +10 -10
  60. package/src/ui/handler_manager.ts +13 -10
  61. package/src/ui/map.test.ts +71 -7
  62. package/src/ui/map.ts +50 -46
  63. package/src/util/browser.ts +2 -1
  64. package/src/util/test/util.ts +18 -0
  65. package/src/util/web_worker_transfer.ts +3 -3
package/README.md CHANGED
@@ -2,12 +2,13 @@
2
2
 
3
3
  # MapLibre GL JS
4
4
 
5
- **[MapLibre GL JS](https://maplibre.org/maplibre-gl-js-docs/api/)** is an open-source library for publishing maps on your websites. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.
5
+ **[MapLibre GL JS](https://maplibre.org/maplibre-gl-js-docs/api/)** is an open-source library for publishing maps on your websites or webview based apps. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.
6
6
 
7
- It originated as an open-source fork of [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js), before their switch to a non-OSS license in December 2020. The library is intended to be a drop-in replacement for the Mapbox’s version with additional functionality.
7
+ It originated as an open-source fork of [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js), before their switch to a non-OSS license in December 2020. The library's initial versions (1.x) were intended to be a drop-in replacement for the Mapbox’s OSS version (1.x) with additional functionality, but have evolved a lot since then.
8
8
 
9
9
  [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg?style=flat)](LICENSE.txt)[![Version](https://img.shields.io/npm/v/maplibre-gl?style=flat)](https://www.npmjs.com/package/maplibre-gl)[![CI](https://github.com/maplibre/maplibre-gl-js/actions/workflows/ci.yml/badge.svg)](https://github.com/maplibre/maplibre-gl-js/actions/workflows/ci.yml)[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://opensource.org/licenses/BSD-3-Clause)
10
10
 
11
+ **Call for Bounties💰** If you have ideas for new features in MapLibre, you can now nominate them for the MapLibre Bounty Program at https://maplibre.org/news/2022-10-16-call-for-bounties/
11
12
  <br />
12
13
 
13
14
  ## Getting Started
@@ -98,7 +99,8 @@ Use MapLibre GL JS bindings for React (https://visgl.github.io/react-map-gl/docs
98
99
 
99
100
  ### Getting Involved
100
101
 
101
- Join the #maplibre slack channel at OSMUS: get an invite at https://osmus-slack.herokuapp.com/
102
+ Join the #maplibre slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/
103
+ Read the [CONTRIBUTING.md](CONTRIBUTING.md) guide in order to get familiar with how we do things around here.
102
104
 
103
105
  ### Community Leadership
104
106
 
@@ -10,6 +10,7 @@ fs.writeFileSync('test/debug-pages/index.html', `
10
10
  <html>
11
11
  <head>
12
12
  <title>Debug Pages</title>
13
+ <link rel="icon" href="about:blank">
13
14
  </head>
14
15
  <body>
15
16
  <h1>Debug Pages</h1>
@@ -130,19 +130,19 @@ export type PromoteIdSpecification = {[_: string]: string} | string;
130
130
 
131
131
  export type ExpressionInputType = string | number | boolean;
132
132
 
133
- export type CollatorExpressionSpecification =
133
+ export type CollatorExpressionSpecification =
134
134
  ['collator', {
135
- 'case-sensitive'?: boolean | ExpressionSpecification,
136
- 'diacritic-sensitive'?: boolean | ExpressionSpecification,
135
+ 'case-sensitive'?: boolean | ExpressionSpecification,
136
+ 'diacritic-sensitive'?: boolean | ExpressionSpecification,
137
137
  locale?: string | ExpressionSpecification}
138
138
  ]; // collator
139
139
 
140
140
  export type InterpolationSpecification =
141
- | ['linear']
142
- | ['exponential', number | ExpressionSpecification]
141
+ | ['linear']
142
+ | ['exponential', number | ExpressionSpecification]
143
143
  | ['cubic-bezier', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification]
144
144
 
145
- export type ExpressionSpecification =
145
+ export type ExpressionSpecification =
146
146
  // types
147
147
  | ['array', unknown | ExpressionSpecification] // array
148
148
  | ['array', ExpressionInputType | ExpressionSpecification, unknown | ExpressionSpecification] // array
@@ -185,20 +185,20 @@ export type ExpressionSpecification =
185
185
  | ['>=', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
186
186
  | ['all', ...(boolean | ExpressionSpecification)[]] // boolean
187
187
  | ['any', ...(boolean | ExpressionSpecification)[]] // boolean
188
- | ['case', boolean | ExpressionSpecification, ExpressionInputType | ExpressionSpecification,
188
+ | ['case', boolean | ExpressionSpecification, ExpressionInputType | ExpressionSpecification,
189
189
  ...(boolean | ExpressionInputType | ExpressionSpecification)[], ExpressionInputType | ExpressionSpecification]
190
190
  | ['coalesce', ...(ExpressionInputType | ExpressionSpecification)[]] // at least two inputs required
191
- | ['match', ExpressionInputType | ExpressionSpecification,
192
- ExpressionInputType | ExpressionInputType[], ExpressionInputType | ExpressionSpecification,
191
+ | ['match', ExpressionInputType | ExpressionSpecification,
192
+ ExpressionInputType | ExpressionInputType[], ExpressionInputType | ExpressionSpecification,
193
193
  ...(ExpressionInputType | ExpressionInputType[] | ExpressionSpecification)[], // repeated as above
194
194
  ExpressionInputType | ExpressionSpecification]
195
195
  | ['within', unknown | ExpressionSpecification]
196
196
  // Ramps, scales, curves
197
- | ['interpolate', InterpolationSpecification, number | ExpressionSpecification,
198
- ...(number | number[] | ColorSpecification)[]] // alternating number and number | number[] | ColorSpecification
199
- | ['interpolate-hcl', InterpolationSpecification, number | ExpressionSpecification,
197
+ | ['interpolate', InterpolationSpecification, number | ExpressionSpecification,
198
+ ...(number | number[] | ColorSpecification | ExpressionSpecification)[]] // alternating number and number | number[] | ColorSpecification
199
+ | ['interpolate-hcl', InterpolationSpecification, number | ExpressionSpecification,
200
200
  ...(number | ColorSpecification)[]] // alternating number and ColorSpecificaton
201
- | ['interpolate-lab', InterpolationSpecification, number | ExpressionSpecification,
201
+ | ['interpolate-lab', InterpolationSpecification, number | ExpressionSpecification,
202
202
  ...(number | ColorSpecification)[]] // alternating number and ColorSpecification
203
203
  | ['step', number | ExpressionSpecification, ExpressionInputType | ExpressionSpecification,
204
204
  ...(number | ExpressionInputType | ExpressionSpecification)[]] // alternating number and ExpressionInputType | ExpressionSpecification
@@ -3,12 +3,11 @@ import typescript from '@rollup/plugin-typescript';
3
3
  import resolve from '@rollup/plugin-node-resolve';
4
4
  import replace from '@rollup/plugin-replace';
5
5
  import commonjs from '@rollup/plugin-commonjs';
6
- import json from '@rollup/plugin-json';
7
- import {terser} from 'rollup-plugin-terser';
6
+ import terser from '@rollup/plugin-terser';
8
7
  import minifyStyleSpec from './rollup_plugin_minify_style_spec';
9
8
  import strip from '@rollup/plugin-strip';
10
9
  import {Plugin} from 'rollup';
11
- import {importAssertionsPlugin} from 'rollup-plugin-import-assert';
10
+ import json from '@rollup/plugin-json';
12
11
 
13
12
  // Common set of plugins/transformations shared across different rollup
14
13
  // builds (main maplibre bundle, style-spec package, benchmarks bundle)
@@ -20,7 +19,6 @@ export const nodeResolve = resolve({
20
19
 
21
20
  export const plugins = (production: boolean): Plugin[] => [
22
21
  minifyStyleSpec(),
23
- importAssertionsPlugin(),
24
22
  json(),
25
23
  // https://github.com/zaach/jison/issues/351
26
24
  replace({