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.
- package/README.md +5 -3
- package/build/generate-debug-index-file.ts +1 -0
- package/build/generate-style-spec.ts +13 -13
- package/build/rollup_plugins.ts +2 -4
- package/dist/maplibre-gl-csp-worker.js +1 -1
- package/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-dev.js +3964 -684
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +332 -319
- package/dist/maplibre-gl.js +4 -4
- package/dist/style-spec/index.d.ts +78 -78
- package/package.json +74 -69
- package/src/css/maplibre-gl.css +5 -0
- package/src/data/bucket/symbol_bucket.test.ts +1 -1
- package/src/data/bucket/symbol_bucket.ts +2 -0
- package/src/geo/transform.test.ts +12 -0
- package/src/geo/transform.ts +5 -7
- package/src/gl/render_pool.test.ts +2 -2
- package/src/gl/state.test.ts +1 -1
- package/src/gl/vertex_buffer.test.ts +3 -3
- package/src/render/draw_fill.test.ts +137 -0
- package/src/render/draw_fill.ts +8 -11
- package/src/render/draw_fill_extrusion.ts +7 -9
- package/src/render/draw_symbol.test.ts +66 -2
- package/src/render/draw_symbol.ts +2 -1
- package/src/render/render_to_texture.test.ts +1 -1
- package/src/render/terrain.test.ts +4 -4
- package/src/render/update_pattern_positions_in_program.ts +46 -0
- package/src/source/image_source.test.ts +26 -0
- package/src/source/image_source.ts +19 -2
- package/src/source/raster_dem_tile_worker_source.ts +1 -1
- package/src/source/terrain_source_cache.test.ts +1 -1
- package/src/source/vector_tile_source.test.ts +1 -1
- package/src/style/style.ts +3 -3
- package/src/style-spec/expression/expression.test.ts +1 -1
- package/src/style-spec/feature_filter/feature_filter.test.ts +1 -0
- package/src/style-spec/migrate.test.ts +1 -1
- package/src/style-spec/reference/v8.json +2 -2
- package/src/style-spec/types.g.ts +13 -13
- package/src/style-spec/validate/validate_terrain.test.ts +1 -1
- package/src/style-spec/validate/validate_terrain.ts +1 -1
- package/src/style-spec/visit.ts +1 -1
- package/src/symbol/cross_tile_symbol_index.test.ts +23 -1
- package/src/symbol/cross_tile_symbol_index.ts +98 -45
- package/src/symbol/placement.ts +9 -2
- package/src/ui/control/attribution_control.ts +2 -2
- package/src/ui/control/navigation_control.test.ts +240 -0
- package/src/ui/control/navigation_control.ts +55 -23
- package/src/ui/handler/drag_handler.ts +166 -0
- package/src/ui/handler/drag_move_state_manager.ts +115 -0
- package/src/ui/handler/mouse.ts +70 -154
- package/src/ui/handler/mouse_handler_interface.test.ts +118 -0
- package/src/ui/handler/mouse_rotate.test.ts +1 -1
- package/src/ui/handler/one_finger_touch_drag.ts +45 -0
- package/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts +84 -0
- package/src/ui/handler/shim/drag_rotate.ts +1 -1
- package/src/ui/handler/shim/{touch_zoom_rotate.ts → two_fingers_touch.ts} +6 -6
- package/src/ui/handler/{touch_zoom_rotate.test.ts → two_fingers_touch.test.ts} +7 -7
- package/src/ui/handler/{touch_zoom_rotate.ts → two_fingers_touch.ts} +10 -10
- package/src/ui/handler_manager.ts +13 -10
- package/src/ui/map.test.ts +71 -7
- package/src/ui/map.ts +50 -46
- package/src/util/browser.ts +2 -1
- package/src/util/test/util.ts +18 -0
- 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
|
|
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.txt)[](https://www.npmjs.com/package/maplibre-gl)[](https://github.com/maplibre/maplibre-gl-js/actions/workflows/ci.yml)[](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://
|
|
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
|
|
|
@@ -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
|
package/build/rollup_plugins.ts
CHANGED
|
@@ -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
|
|
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
|
|
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({
|