maplibre-gl 2.0.5 → 2.1.3
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/build/{banner.js → banner.ts} +1 -1
- package/build/generate-query-test-fixtures.ts +123 -0
- package/build/generate-shaders.ts +35 -0
- package/build/generate-struct-arrays.ts +7 -7
- package/build/generate-style-code.ts +8 -8
- package/build/generate-style-spec.ts +5 -4
- package/build/generate-typings.ts +16 -0
- package/build/readme.md +8 -18
- package/build/release-notes.js +9 -13
- package/build/{rollup_plugin_minify_style_spec.js → rollup_plugin_minify_style_spec.ts} +4 -3
- package/build/{rollup_plugins.js → rollup_plugins.ts} +12 -26
- package/dist/maplibre-gl-dev.js +54885 -0
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +1574 -1022
- package/dist/maplibre-gl.js +3 -3
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +94 -131
- package/src/css/maplibre-gl.css +49 -49
- package/src/data/{array_types.ts → array_types.g.ts} +0 -0
- package/src/data/bucket/circle_bucket.ts +1 -1
- package/src/data/bucket/fill_bucket.test.ts +1 -1
- package/src/data/bucket/fill_bucket.ts +4 -4
- package/src/data/bucket/fill_extrusion_bucket.ts +1 -1
- package/src/data/bucket/line_bucket.test.ts +1 -1
- package/src/data/bucket/line_bucket.ts +6 -6
- package/src/data/bucket/symbol_bucket.test.ts +16 -16
- package/src/data/bucket/symbol_bucket.ts +56 -56
- package/src/data/bucket.ts +43 -43
- package/src/data/dem_data.ts +12 -12
- package/src/data/evaluation_feature.ts +10 -10
- package/src/data/feature_index.ts +37 -37
- package/src/data/feature_position_map.ts +5 -5
- package/src/data/index_array_type.ts +1 -1
- package/src/data/load_geometry.test.ts +1 -1
- package/src/data/program_configuration.ts +47 -47
- package/src/data/segment.ts +14 -14
- package/src/geo/edge_insets.ts +2 -2
- package/src/geo/lng_lat.ts +4 -4
- package/src/geo/lng_lat_bounds.ts +35 -35
- package/src/geo/mercator_coordinate.ts +5 -5
- package/src/geo/transform.test.ts +1 -1
- package/src/geo/transform.ts +14 -14
- package/src/gl/context.ts +3 -3
- package/src/gl/types.ts +19 -19
- package/src/gl/value.ts +6 -6
- package/src/gl/vertex_buffer.test.ts +1 -1
- package/src/index.ts +24 -9
- package/src/render/draw_circle.ts +8 -8
- package/src/render/draw_collision_debug.ts +5 -5
- package/src/render/draw_debug.ts +1 -1
- package/src/render/draw_line.ts +4 -4
- package/src/render/draw_symbol.ts +21 -21
- package/src/render/glyph_atlas.ts +12 -12
- package/src/render/glyph_manager.test.ts +10 -21
- package/src/render/glyph_manager.ts +34 -33
- package/src/render/image_manager.ts +4 -4
- package/src/render/painter.ts +16 -14
- package/src/render/program/background_program.ts +29 -29
- package/src/render/program/circle_program.ts +11 -11
- package/src/render/program/clipping_mask_program.ts +1 -1
- package/src/render/program/collision_program.ts +9 -9
- package/src/render/program/debug_program.ts +4 -4
- package/src/render/program/fill_extrusion_program.ts +31 -31
- package/src/render/program/fill_program.ts +29 -29
- package/src/render/program/heatmap_program.ts +12 -12
- package/src/render/program/hillshade_program.ts +12 -12
- package/src/render/program/line_program.ts +41 -41
- package/src/render/program/pattern.ts +28 -28
- package/src/render/program/raster_program.ts +21 -21
- package/src/render/program/symbol_program.ts +97 -97
- package/src/render/program.ts +25 -25
- package/src/render/texture.ts +9 -9
- package/src/render/uniform_binding.ts +1 -1
- package/src/render/vertex_array_object.ts +13 -13
- package/src/shaders/_prelude.fragment.glsl.g.ts +2 -0
- package/src/shaders/_prelude.vertex.glsl.g.ts +2 -0
- package/src/shaders/background.fragment.glsl.g.ts +2 -0
- package/src/shaders/background.vertex.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.fragment.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_box.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_box.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/debug.fragment.glsl.g.ts +2 -0
- package/src/shaders/debug.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.vertex.glsl.g.ts +2 -0
- package/src/shaders/line.fragment.glsl.g.ts +2 -0
- package/src/shaders/line.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/raster.fragment.glsl.g.ts +2 -0
- package/src/shaders/raster.vertex.glsl.g.ts +2 -0
- package/src/shaders/shaders.ts +52 -55
- package/src/shaders/symbol_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_icon.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts +2 -0
- package/src/source/canvas_source.test.ts +11 -12
- package/src/source/canvas_source.ts +4 -4
- package/src/source/geojson_source.test.ts +2 -1
- package/src/source/geojson_source.ts +1 -1
- package/src/source/geojson_worker_source.ts +23 -23
- package/src/source/geojson_wrapper.ts +8 -8
- package/src/source/image_source.test.ts +2 -2
- package/src/source/image_source.ts +6 -6
- package/src/source/pixels_to_tile_units.ts +6 -6
- package/src/source/query_features.ts +20 -20
- package/src/source/raster_dem_tile_source.test.ts +4 -3
- package/src/source/raster_dem_tile_source.ts +1 -1
- package/src/source/raster_tile_source.test.ts +4 -3
- package/src/source/raster_tile_source.ts +1 -1
- package/src/source/rtl_text_plugin.ts +10 -10
- package/src/source/source.ts +29 -29
- package/src/source/source_cache.test.ts +33 -1
- package/src/source/source_cache.ts +7 -5
- package/src/source/source_state.ts +1 -1
- package/src/source/tile.test.ts +3 -3
- package/src/source/tile.ts +15 -15
- package/src/source/tile_cache.test.ts +6 -4
- package/src/source/tile_cache.ts +6 -6
- package/src/source/tile_id.test.ts +10 -13
- package/src/source/tile_id.ts +2 -2
- package/src/source/vector_tile_source.test.ts +17 -5
- package/src/source/vector_tile_source.ts +4 -5
- package/src/source/vector_tile_worker_source.test.ts +4 -4
- package/src/source/vector_tile_worker_source.ts +5 -5
- package/src/source/worker.test.ts +1 -1
- package/src/source/worker.ts +22 -22
- package/src/source/worker_source.ts +56 -56
- package/src/source/worker_tile.ts +4 -4
- package/src/style/evaluation_parameters.ts +3 -3
- package/src/style/format_section_override.test.ts +1 -1
- package/src/style/light.ts +10 -10
- package/src/style/load_glyph_range.test.ts +3 -5
- package/src/style/load_glyph_range.ts +6 -6
- package/src/style/load_sprite.ts +5 -4
- package/src/style/pauseable_placement.ts +1 -1
- package/src/style/properties.ts +70 -70
- package/src/style/query_utils.ts +7 -7
- package/src/style/style.test.ts +26 -15
- package/src/style/style.ts +30 -30
- package/src/style/style_glyph.ts +8 -8
- package/src/style/style_image.ts +58 -58
- package/src/style/style_layer/background_style_layer.ts +2 -2
- package/src/style/style_layer/{background_style_layer_properties.ts → background_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/circle_style_layer.ts +10 -10
- package/src/style/style_layer/{circle_style_layer_properties.ts → circle_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/custom_style_layer.ts +19 -19
- package/src/style/style_layer/fill_extrusion_style_layer.ts +11 -11
- package/src/style/style_layer/{fill_extrusion_style_layer_properties.ts → fill_extrusion_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/fill_style_layer.ts +9 -9
- package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/heatmap_style_layer.ts +2 -2
- package/src/style/style_layer/{heatmap_style_layer_properties.ts → heatmap_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/hillshade_style_layer.ts +2 -2
- package/src/style/style_layer/{hillshade_style_layer_properties.ts → hillshade_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/line_style_layer.ts +9 -9
- package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/raster_style_layer.ts +2 -2
- package/src/style/style_layer/{raster_style_layer_properties.ts → raster_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/symbol_style_layer.ts +26 -7
- package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +6 -0
- package/src/style/style_layer.ts +10 -10
- package/src/style/style_layer_index.ts +3 -3
- package/src/style/validate_style.ts +15 -15
- package/src/style-spec/CHANGELOG.md +6 -0
- package/src/style-spec/error/validation_error.ts +1 -1
- package/src/style-spec/expression/compound_expression.ts +3 -3
- package/src/style-spec/expression/definitions/format.ts +11 -11
- package/src/style-spec/expression/definitions/interpolate.ts +5 -5
- package/src/style-spec/expression/definitions/match.ts +2 -2
- package/src/style-spec/expression/definitions/number_format.ts +11 -11
- package/src/style-spec/expression/expression.ts +8 -8
- package/src/style-spec/expression/index.ts +97 -97
- package/src/style-spec/expression/parsing_context.ts +11 -11
- package/src/style-spec/expression/types/collator.ts +9 -9
- package/src/style-spec/expression/types/resolved_image.ts +2 -2
- package/src/style-spec/expression/types.ts +14 -14
- package/src/style-spec/expression/values.ts +1 -1
- package/src/style-spec/feature_filter/index.ts +66 -66
- package/src/style-spec/function/convert.ts +3 -3
- package/src/style-spec/package.json +1 -1
- package/src/style-spec/reference/v8.json +68 -2
- package/src/style-spec/style-spec.ts +44 -44
- package/src/style-spec/types.ts +2 -0
- package/src/style-spec/util/color_spaces.ts +8 -8
- package/src/style-spec/util/result.ts +4 -4
- package/src/style-spec/validate/validate_filter.ts +58 -58
- package/src/style-spec/validate/validate_source.ts +63 -63
- package/src/style-spec/visit.ts +11 -11
- package/src/symbol/collision_feature.test.ts +1 -1
- package/src/symbol/collision_feature.ts +10 -10
- package/src/symbol/collision_index.ts +43 -43
- package/src/symbol/cross_tile_symbol_index.ts +17 -17
- package/src/symbol/get_anchors.ts +16 -16
- package/src/symbol/grid_index.test.ts +42 -19
- package/src/symbol/grid_index.ts +69 -40
- package/src/symbol/placement.ts +124 -95
- package/src/symbol/projection.ts +30 -30
- package/src/symbol/quads.ts +30 -30
- package/src/symbol/shaping.ts +160 -160
- package/src/symbol/symbol_layout.ts +119 -119
- package/src/symbol/symbol_size.ts +29 -29
- package/src/symbol/symbol_style_layer.test.ts +49 -2
- package/src/types/cancelable.ts +1 -1
- package/src/types/tilejson.ts +13 -13
- package/src/ui/anchor.ts +1 -1
- package/src/ui/camera.test.ts +9 -9
- package/src/ui/camera.ts +18 -18
- package/src/ui/control/attribution_control.test.ts +51 -16
- package/src/ui/control/attribution_control.ts +35 -16
- package/src/ui/control/control.ts +40 -40
- package/src/ui/control/fullscreen_control.ts +1 -1
- package/src/ui/control/geolocate_control.test.ts +1 -1
- package/src/ui/control/geolocate_control.ts +102 -102
- package/src/ui/control/logo_control.test.ts +5 -4
- package/src/ui/control/navigation_control.ts +3 -3
- package/src/ui/control/scale_control.test.ts +2 -2
- package/src/ui/control/scale_control.ts +5 -5
- package/src/ui/events.ts +289 -200
- package/src/ui/handler/box_zoom.test.ts +1 -1
- package/src/ui/handler/box_zoom.ts +1 -1
- package/src/ui/handler/dblclick_zoom.test.ts +1 -1
- package/src/ui/handler/drag_pan.test.ts +1 -1
- package/src/ui/handler/drag_rotate.test.ts +1 -1
- package/src/ui/handler/keyboard.test.ts +1 -1
- package/src/ui/handler/keyboard.ts +51 -51
- package/src/ui/handler/map_event.test.ts +1 -1
- package/src/ui/handler/map_event.ts +1 -1
- package/src/ui/handler/mouse.ts +1 -1
- package/src/ui/handler/mouse_rotate.test.ts +1 -1
- package/src/ui/handler/scroll_zoom.test.ts +3 -2
- package/src/ui/handler/scroll_zoom.ts +9 -9
- package/src/ui/handler/shim/drag_pan.ts +4 -4
- package/src/ui/handler/shim/drag_rotate.ts +1 -1
- package/src/ui/handler/shim/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler/tap_recognizer.ts +4 -4
- package/src/ui/handler/touch_pan.ts +2 -2
- package/src/ui/handler/touch_zoom_rotate.test.ts +1 -1
- package/src/ui/handler/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler_inertia.ts +6 -6
- package/src/ui/handler_manager.ts +44 -44
- package/src/ui/map/isMoving.test.ts +1 -1
- package/src/ui/map/isRotating.test.ts +1 -1
- package/src/ui/map/isZooming.test.ts +1 -1
- package/src/ui/map.test.ts +87 -14
- package/src/ui/map.ts +136 -106
- package/src/ui/map_events.test.ts +1 -1
- package/src/ui/marker.test.ts +12 -12
- package/src/ui/marker.ts +37 -37
- package/src/ui/popup.test.ts +7 -7
- package/src/ui/popup.ts +9 -9
- package/src/util/actor.test.ts +41 -10
- package/src/util/actor.ts +8 -8
- package/src/util/ajax.test.ts +29 -21
- package/src/util/ajax.ts +51 -30
- package/src/util/browser.ts +1 -1
- package/src/util/classify_rings.test.ts +1 -1
- package/src/util/color_ramp.ts +5 -5
- package/src/util/config.ts +2 -2
- package/src/util/dispatcher.ts +1 -1
- package/src/util/dom.ts +2 -2
- package/src/util/evented.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.ts +3 -3
- package/src/util/image.ts +5 -5
- package/src/util/performance.ts +7 -7
- package/src/util/request_manager.ts +4 -4
- package/src/util/resolve_tokens.ts +4 -4
- package/src/util/struct_array.test.ts +1 -1
- package/src/util/struct_array.ts +15 -15
- package/src/util/task_queue.ts +3 -3
- package/src/util/tile_request_cache.ts +3 -3
- package/src/util/transferable_grid_index.ts +4 -4
- package/src/util/util.ts +8 -8
- package/src/util/web_worker.ts +4 -68
- package/src/util/web_worker_transfer.test.ts +3 -0
- package/src/util/web_worker_transfer.ts +21 -17
- package/src/util/worker_pool.ts +1 -1
- package/build/.eslintrc +0 -21
- package/build/glsl_to_js.js +0 -12
- package/build/post-ts-build.js +0 -43
- package/build/release-notes.md.ejs +0 -8
- package/build/test/build-tape.js +0 -17
- package/build/web_worker_replacement.js +0 -5
- package/dist/package.json +0 -1
- package/src/style-spec/validate_spec.test.ts +0 -29
- package/src/symbol/shaping.test.ts +0 -392
- package/src/types/glsl.d.ts +0 -4
package/src/ui/marker.test.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Marker from './marker';
|
|
|
3
3
|
import Popup from './popup';
|
|
4
4
|
import LngLat from '../geo/lng_lat';
|
|
5
5
|
import Point from '@mapbox/point-geometry';
|
|
6
|
-
import simulate from '../../test/
|
|
6
|
+
import simulate from '../../test/unit/lib/simulate_interaction';
|
|
7
7
|
|
|
8
8
|
function createMap(options = {}) {
|
|
9
9
|
const container = window.document.createElement('div');
|
|
@@ -46,16 +46,16 @@ describe('marker', () => {
|
|
|
46
46
|
|
|
47
47
|
// initial dimensions of svg element
|
|
48
48
|
expect(
|
|
49
|
-
|
|
49
|
+
defaultMarker.getElement().children[0].getAttribute('height').includes('41')
|
|
50
50
|
).toBeTruthy();
|
|
51
51
|
expect(defaultMarker.getElement().children[0].getAttribute('width').includes('27')).toBeTruthy();
|
|
52
52
|
|
|
53
53
|
// (41 * 0.8) = 32.8, (27 * 0.8) = 21.6
|
|
54
54
|
expect(
|
|
55
|
-
|
|
55
|
+
smallerMarker.getElement().children[0].getAttribute('height').includes('32.8')
|
|
56
56
|
).toBeTruthy();
|
|
57
57
|
expect(
|
|
58
|
-
|
|
58
|
+
smallerMarker.getElement().children[0].getAttribute('width').includes('21.6')
|
|
59
59
|
).toBeTruthy();
|
|
60
60
|
|
|
61
61
|
// (41 * 2) = 82, (27 * 2) = 54
|
|
@@ -287,49 +287,49 @@ describe('marker', () => {
|
|
|
287
287
|
|
|
288
288
|
// marker should default to above since it has enough space
|
|
289
289
|
expect(
|
|
290
|
-
|
|
290
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-bottom')
|
|
291
291
|
).toBeTruthy();
|
|
292
292
|
|
|
293
293
|
// move marker to the top forcing the popup to below
|
|
294
294
|
marker.setLngLat(map.unproject([mapHeight / 2, markerTop]));
|
|
295
295
|
expect(
|
|
296
|
-
|
|
296
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-top')
|
|
297
297
|
).toBeTruthy();
|
|
298
298
|
|
|
299
299
|
// move marker to the right forcing the popup to the left
|
|
300
300
|
marker.setLngLat(map.unproject([mapHeight - markerRight, mapHeight / 2]));
|
|
301
301
|
expect(
|
|
302
|
-
|
|
302
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-right')
|
|
303
303
|
).toBeTruthy();
|
|
304
304
|
|
|
305
305
|
// move marker to the left forcing the popup to the right
|
|
306
306
|
marker.setLngLat(map.unproject([markerRight, mapHeight / 2]));
|
|
307
307
|
expect(
|
|
308
|
-
|
|
308
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-left')
|
|
309
309
|
).toBeTruthy();
|
|
310
310
|
|
|
311
311
|
// move marker to the top left forcing the popup to the bottom right
|
|
312
312
|
marker.setLngLat(map.unproject([markerRight, markerTop]));
|
|
313
313
|
expect(
|
|
314
|
-
|
|
314
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-top-left')
|
|
315
315
|
).toBeTruthy();
|
|
316
316
|
|
|
317
317
|
// move marker to the top right forcing the popup to the bottom left
|
|
318
318
|
marker.setLngLat(map.unproject([mapHeight - markerRight, markerTop]));
|
|
319
319
|
expect(
|
|
320
|
-
|
|
320
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-top-right')
|
|
321
321
|
).toBeTruthy();
|
|
322
322
|
|
|
323
323
|
// move marker to the bottom left forcing the popup to the top right
|
|
324
324
|
marker.setLngLat(map.unproject([markerRight, mapHeight]));
|
|
325
325
|
expect(
|
|
326
|
-
|
|
326
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-bottom-left')
|
|
327
327
|
).toBeTruthy();
|
|
328
328
|
|
|
329
329
|
// move marker to the bottom right forcing the popup to the top left
|
|
330
330
|
marker.setLngLat(map.unproject([mapHeight - markerRight, mapHeight]));
|
|
331
331
|
expect(
|
|
332
|
-
|
|
332
|
+
marker.getPopup()._container.classList.contains('maplibregl-popup-anchor-bottom-right')
|
|
333
333
|
).toBeTruthy();
|
|
334
334
|
|
|
335
335
|
});
|
package/src/ui/marker.ts
CHANGED
|
@@ -13,16 +13,16 @@ import type {MapMouseEvent, MapTouchEvent} from './events';
|
|
|
13
13
|
import type {PointLike} from './camera';
|
|
14
14
|
|
|
15
15
|
type MarkerOptions = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
element?: HTMLElement;
|
|
17
|
+
offset?: PointLike;
|
|
18
|
+
anchor?: PositionAnchor;
|
|
19
|
+
color?: string;
|
|
20
|
+
scale?: number;
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
clickTolerance?: number;
|
|
23
|
+
rotation?: number;
|
|
24
|
+
rotationAlignment?: string;
|
|
25
|
+
pitchAlignment?: string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -289,29 +289,29 @@ export default class Marker extends Evented {
|
|
|
289
289
|
* the marker on screen.
|
|
290
290
|
*
|
|
291
291
|
* @returns {LngLat} A {@link LngLat} describing the marker's location.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
292
|
+
* @example
|
|
293
|
+
* // Store the marker's longitude and latitude coordinates in a variable
|
|
294
|
+
* var lngLat = marker.getLngLat();
|
|
295
|
+
* // Print the marker's longitude and latitude values in the console
|
|
296
|
+
* console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
|
|
297
|
+
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
298
|
+
*/
|
|
299
299
|
getLngLat() {
|
|
300
300
|
return this._lngLat;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
304
|
+
* Set the marker's geographical position and move it.
|
|
305
|
+
* @param {LngLat} lnglat A {@link LngLat} describing where the marker should be located.
|
|
306
|
+
* @returns {Marker} `this`
|
|
307
|
+
* @example
|
|
308
|
+
* // Create a new marker, set the longitude and latitude, and add it to the map
|
|
309
|
+
* new maplibregl.Marker()
|
|
310
|
+
* .setLngLat([-65.017, -16.457])
|
|
311
|
+
* .addTo(map);
|
|
312
|
+
* @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js-docs/example/custom-marker-icons/)
|
|
313
|
+
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
314
|
+
*/
|
|
315
315
|
setLngLat(lnglat: LngLatLike) {
|
|
316
316
|
this._lngLat = LngLat.convert(lnglat);
|
|
317
317
|
this._pos = null;
|
|
@@ -437,7 +437,7 @@ export default class Marker extends Evented {
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
_update(e?: {
|
|
440
|
-
|
|
440
|
+
type: 'move' | 'moveend';
|
|
441
441
|
}) {
|
|
442
442
|
if (!this._map) return;
|
|
443
443
|
|
|
@@ -545,14 +545,14 @@ export default class Marker extends Evented {
|
|
|
545
545
|
// only fire dragend if it was preceded by at least one drag event
|
|
546
546
|
if (this._state === 'active') {
|
|
547
547
|
/**
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
548
|
+
* Fired when the marker is finished being dragged
|
|
549
|
+
*
|
|
550
|
+
* @event dragend
|
|
551
|
+
* @memberof Marker
|
|
552
|
+
* @instance
|
|
553
|
+
* @type {Object}
|
|
554
|
+
* @property {Marker} marker object that was dragged
|
|
555
|
+
*/
|
|
556
556
|
this.fire(new Event('dragend'));
|
|
557
557
|
}
|
|
558
558
|
|
package/src/ui/popup.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {createMap as globalCreateMap, setPerformance, setWebGlContext} from '../
|
|
|
2
2
|
import Popup, {Offset} from './popup';
|
|
3
3
|
import LngLat from '../geo/lng_lat';
|
|
4
4
|
import Point from '@mapbox/point-geometry';
|
|
5
|
-
import simulate from '../../test/
|
|
5
|
+
import simulate from '../../test/unit/lib/simulate_interaction';
|
|
6
6
|
import {PositionAnchor} from './anchor';
|
|
7
7
|
|
|
8
8
|
const containerWidth = 512;
|
|
@@ -91,7 +91,7 @@ describe('popup', () => {
|
|
|
91
91
|
.addTo(map);
|
|
92
92
|
|
|
93
93
|
expect(
|
|
94
|
-
|
|
94
|
+
popup.getElement().querySelectorAll('.maplibregl-popup-close-button')
|
|
95
95
|
).toHaveLength(0);
|
|
96
96
|
});
|
|
97
97
|
|
|
@@ -561,7 +561,7 @@ describe('popup', () => {
|
|
|
561
561
|
.addTo(map);
|
|
562
562
|
|
|
563
563
|
expect(
|
|
564
|
-
|
|
564
|
+
popup._container.classList.value
|
|
565
565
|
).toContain('maplibregl-popup-track-pointer');
|
|
566
566
|
});
|
|
567
567
|
|
|
@@ -574,7 +574,7 @@ describe('popup', () => {
|
|
|
574
574
|
popup.setText('Test');
|
|
575
575
|
|
|
576
576
|
expect(
|
|
577
|
-
|
|
577
|
+
popup._container.classList.value
|
|
578
578
|
).toContain('maplibregl-popup-track-pointer');
|
|
579
579
|
});
|
|
580
580
|
|
|
@@ -587,7 +587,7 @@ describe('popup', () => {
|
|
|
587
587
|
popup.trackPointer();
|
|
588
588
|
|
|
589
589
|
expect(
|
|
590
|
-
|
|
590
|
+
popup._container.classList.value
|
|
591
591
|
).toContain('maplibregl-popup-track-pointer');
|
|
592
592
|
});
|
|
593
593
|
|
|
@@ -601,7 +601,7 @@ describe('popup', () => {
|
|
|
601
601
|
|
|
602
602
|
expect(popup._pos).toEqual(map.project([0, 0]));
|
|
603
603
|
expect(
|
|
604
|
-
|
|
604
|
+
popup._container.classList.value
|
|
605
605
|
).not.toContain('maplibregl-popup-track-pointer');
|
|
606
606
|
});
|
|
607
607
|
|
|
@@ -613,7 +613,7 @@ describe('popup', () => {
|
|
|
613
613
|
.addTo(map);
|
|
614
614
|
|
|
615
615
|
expect(
|
|
616
|
-
|
|
616
|
+
popup._container.classList.value
|
|
617
617
|
).not.toContain('maplibregl-popup-track-pointer');
|
|
618
618
|
});
|
|
619
619
|
|
package/src/ui/popup.ts
CHANGED
|
@@ -21,18 +21,18 @@ const defaultOptions = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type Offset = number | PointLike | {
|
|
24
|
-
|
|
24
|
+
[_ in PositionAnchor]: PointLike;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export type PopupOptions = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
closeButton?: boolean;
|
|
29
|
+
closeOnClick?: boolean;
|
|
30
|
+
closeOnMove?: boolean;
|
|
31
|
+
focusAfterOpen?: boolean;
|
|
32
|
+
anchor?: PositionAnchor;
|
|
33
|
+
offset?: Offset;
|
|
34
|
+
className?: string;
|
|
35
|
+
maxWidth?: string;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const focusQuerySelector = [
|
package/src/util/actor.test.ts
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
import Actor from './actor';
|
|
2
2
|
import workerFactory from './web_worker';
|
|
3
|
+
import {MessageBus} from '../../test/unit/lib/web_worker_mock';
|
|
4
|
+
|
|
5
|
+
const originalWorker = global.Worker;
|
|
6
|
+
|
|
7
|
+
function setTestWorker(MockWorker: { new(...args: any): any}) {
|
|
8
|
+
(global as any).Worker = function Worker(_: string) {
|
|
9
|
+
const parentListeners = [];
|
|
10
|
+
const workerListeners = [];
|
|
11
|
+
const parentBus = new MessageBus(workerListeners, parentListeners);
|
|
12
|
+
const workerBus = new MessageBus(parentListeners, workerListeners);
|
|
13
|
+
|
|
14
|
+
parentBus.target = workerBus;
|
|
15
|
+
workerBus.target = parentBus;
|
|
16
|
+
|
|
17
|
+
new MockWorker(workerBus);
|
|
18
|
+
|
|
19
|
+
return parentBus;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
3
22
|
|
|
4
23
|
describe('Actor', () => {
|
|
24
|
+
afterAll(() => {
|
|
25
|
+
global.Worker = originalWorker;
|
|
26
|
+
});
|
|
27
|
+
|
|
5
28
|
test('forwards responses to correct callback', done => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
29
|
+
setTestWorker(class MockWorker {
|
|
30
|
+
self: any;
|
|
31
|
+
actor: Actor;
|
|
32
|
+
constructor(self) {
|
|
33
|
+
this.self = self;
|
|
34
|
+
this.actor = new Actor(self, this);
|
|
35
|
+
}
|
|
36
|
+
test(mapId, params, callback) {
|
|
10
37
|
setTimeout(callback, 0, null, params);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
13
40
|
|
|
14
41
|
const worker = workerFactory();
|
|
15
42
|
|
|
@@ -38,10 +65,14 @@ describe('Actor', () => {
|
|
|
38
65
|
test('targets worker-initiated messages to correct map instance', done => {
|
|
39
66
|
let workerActor;
|
|
40
67
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
setTestWorker(class MockWorker {
|
|
69
|
+
self: any;
|
|
70
|
+
actor: Actor;
|
|
71
|
+
constructor(self) {
|
|
72
|
+
this.self = self;
|
|
73
|
+
this.actor = workerActor = new Actor(self, this);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
45
76
|
|
|
46
77
|
const worker = workerFactory();
|
|
47
78
|
|
package/src/util/actor.ts
CHANGED
|
@@ -21,15 +21,15 @@ class Actor {
|
|
|
21
21
|
parent: any;
|
|
22
22
|
mapId: number;
|
|
23
23
|
callbacks: {
|
|
24
|
-
|
|
24
|
+
number: any;
|
|
25
25
|
};
|
|
26
26
|
name: string;
|
|
27
27
|
tasks: {
|
|
28
|
-
|
|
28
|
+
number: any;
|
|
29
29
|
};
|
|
30
30
|
taskQueue: Array<number>;
|
|
31
31
|
cancelCallbacks: {
|
|
32
|
-
|
|
32
|
+
number: Cancelable;
|
|
33
33
|
};
|
|
34
34
|
invoker: ThrottledInvoker;
|
|
35
35
|
globalScope: any;
|
|
@@ -57,11 +57,11 @@ class Actor {
|
|
|
57
57
|
* @private
|
|
58
58
|
*/
|
|
59
59
|
send(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
type: string,
|
|
61
|
+
data: unknown,
|
|
62
|
+
callback?: Function | null,
|
|
63
|
+
targetMapId?: string | null,
|
|
64
|
+
mustQueue: boolean = false
|
|
65
65
|
): Cancelable {
|
|
66
66
|
// We're using a string ID instead of numbers because they are being used as object keys
|
|
67
67
|
// anyway, and thus stringified implicitly. We use random IDs because an actor may receive
|
package/src/util/ajax.test.ts
CHANGED
|
@@ -3,15 +3,25 @@ import {
|
|
|
3
3
|
getJSON,
|
|
4
4
|
postData,
|
|
5
5
|
getImage,
|
|
6
|
-
resetImageRequestQueue
|
|
6
|
+
resetImageRequestQueue,
|
|
7
|
+
AJAXError
|
|
7
8
|
} from './ajax';
|
|
8
9
|
import config from './config';
|
|
9
10
|
import webpSupported from './webp_supported';
|
|
10
|
-
import {fakeServer,
|
|
11
|
+
import {fakeServer, FakeServer} from 'nise';
|
|
11
12
|
import {stubAjaxGetImage} from './test/util';
|
|
12
13
|
|
|
14
|
+
function readAsText(blob) {
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const fileReader = new FileReader();
|
|
17
|
+
fileReader.onload = () => resolve(fileReader.result);
|
|
18
|
+
fileReader.onerror = () => reject(fileReader.error);
|
|
19
|
+
fileReader.readAsText(blob);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
describe('ajax', () => {
|
|
14
|
-
let server:
|
|
24
|
+
let server: FakeServer;
|
|
15
25
|
beforeEach(() => {
|
|
16
26
|
global.fetch = null;
|
|
17
27
|
server = fakeServer.create();
|
|
@@ -22,10 +32,15 @@ describe('ajax', () => {
|
|
|
22
32
|
|
|
23
33
|
test('getArrayBuffer, 404', done => {
|
|
24
34
|
server.respondWith(request => {
|
|
25
|
-
request.respond(404, undefined,
|
|
35
|
+
request.respond(404, undefined, '404 Not Found');
|
|
26
36
|
});
|
|
27
|
-
getArrayBuffer({url:''}, (error) => {
|
|
28
|
-
|
|
37
|
+
getArrayBuffer({url:'http://example.com/test.bin'}, async (error) => {
|
|
38
|
+
const ajaxError = error as AJAXError;
|
|
39
|
+
const body = await readAsText(ajaxError.body);
|
|
40
|
+
expect(ajaxError.status).toBe(404);
|
|
41
|
+
expect(ajaxError.statusText).toBe('Not Found');
|
|
42
|
+
expect(ajaxError.url).toBe('http://example.com/test.bin');
|
|
43
|
+
expect(body).toBe('404 Not Found');
|
|
29
44
|
done();
|
|
30
45
|
});
|
|
31
46
|
server.respond();
|
|
@@ -56,22 +71,15 @@ describe('ajax', () => {
|
|
|
56
71
|
|
|
57
72
|
test('getJSON, 404', done => {
|
|
58
73
|
server.respondWith(request => {
|
|
59
|
-
request.respond(404, undefined,
|
|
60
|
-
});
|
|
61
|
-
getJSON({url:''}, (error) => {
|
|
62
|
-
expect((error as any).status).toBe(404);
|
|
63
|
-
done();
|
|
74
|
+
request.respond(404, undefined, '404 Not Found');
|
|
64
75
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
getJSON({url:''}, (error) => {
|
|
73
|
-
expect((error as any).status).toBe(401);
|
|
74
|
-
expect(error.message).toBe('Unauthorized');
|
|
76
|
+
getJSON({url:'http://example.com/test.json'}, async (error) => {
|
|
77
|
+
const ajaxError = error as AJAXError;
|
|
78
|
+
const body = await readAsText(ajaxError.body);
|
|
79
|
+
expect(ajaxError.status).toBe(404);
|
|
80
|
+
expect(ajaxError.statusText).toBe('Not Found');
|
|
81
|
+
expect(ajaxError.url).toBe('http://example.com/test.json');
|
|
82
|
+
expect(body).toBe('404 Not Found');
|
|
75
83
|
done();
|
|
76
84
|
});
|
|
77
85
|
server.respond();
|
package/src/util/ajax.ts
CHANGED
|
@@ -64,37 +64,57 @@ if (typeof Object.freeze == 'function') {
|
|
|
64
64
|
*
|
|
65
65
|
*/
|
|
66
66
|
export type RequestParameters = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
url: string;
|
|
68
|
+
headers?: any;
|
|
69
|
+
method?: 'GET' | 'POST' | 'PUT';
|
|
70
|
+
body?: string;
|
|
71
|
+
type?: 'string' | 'json' | 'arrayBuffer';
|
|
72
|
+
credentials?: 'same-origin' | 'include';
|
|
73
|
+
collectResourceTiming?: boolean;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
export type ResponseCallback<T> = (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
error?: Error | null,
|
|
78
|
+
data?: T | null,
|
|
79
|
+
cacheControl?: string | null,
|
|
80
|
+
expires?: string | null
|
|
81
81
|
) => void;
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* An error thrown when a HTTP request results in an error response.
|
|
85
|
+
* @extends Error
|
|
86
|
+
* @param {number} status The response's HTTP status code.
|
|
87
|
+
* @param {string} statusText The response's HTTP status text.
|
|
88
|
+
* @param {string} url The request's URL.
|
|
89
|
+
* @param {Blob} body The response's body.
|
|
90
|
+
*/
|
|
91
|
+
export class AJAXError extends Error {
|
|
92
|
+
/**
|
|
93
|
+
* The response's HTTP status code.
|
|
94
|
+
*/
|
|
84
95
|
status: number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The response's HTTP status text.
|
|
99
|
+
*/
|
|
100
|
+
statusText: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The request's URL.
|
|
104
|
+
*/
|
|
85
105
|
url: string;
|
|
86
|
-
constructor(message: string, status: number, url: string) {
|
|
87
|
-
super(message);
|
|
88
|
-
this.status = status;
|
|
89
|
-
this.url = url;
|
|
90
106
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
/**
|
|
108
|
+
* The response's body.
|
|
109
|
+
*/
|
|
110
|
+
body: Blob;
|
|
95
111
|
|
|
96
|
-
|
|
97
|
-
|
|
112
|
+
constructor(status: number, statusText: string, url: string, body: Blob) {
|
|
113
|
+
super(`AJAXError: ${statusText} (${status}): ${url}`);
|
|
114
|
+
this.status = status;
|
|
115
|
+
this.statusText = statusText;
|
|
116
|
+
this.url = url;
|
|
117
|
+
this.body = body;
|
|
98
118
|
}
|
|
99
119
|
}
|
|
100
120
|
|
|
@@ -159,7 +179,7 @@ function makeFetchRequest(requestParameters: RequestParameters, callback: Respon
|
|
|
159
179
|
return finishRequest(response, cacheableResponse, requestTime);
|
|
160
180
|
|
|
161
181
|
} else {
|
|
162
|
-
return callback(new AJAXError(response.
|
|
182
|
+
return response.blob().then(body => callback(new AJAXError(response.status, response.statusText, requestParameters.url, body)));
|
|
163
183
|
}
|
|
164
184
|
}).catch(error => {
|
|
165
185
|
if (error.code === 20) {
|
|
@@ -173,8 +193,8 @@ function makeFetchRequest(requestParameters: RequestParameters, callback: Respon
|
|
|
173
193
|
const finishRequest = (response, cacheableResponse?, requestTime?) => {
|
|
174
194
|
(
|
|
175
195
|
requestParameters.type === 'arrayBuffer' ? response.arrayBuffer() :
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
requestParameters.type === 'json' ? response.json() :
|
|
197
|
+
response.text()
|
|
178
198
|
).then(result => {
|
|
179
199
|
if (aborted) return;
|
|
180
200
|
if (cacheableResponse && requestTime) {
|
|
@@ -235,7 +255,8 @@ function makeXMLHttpRequest(requestParameters: RequestParameters, callback: Resp
|
|
|
235
255
|
}
|
|
236
256
|
callback(null, data, xhr.getResponseHeader('Cache-Control'), xhr.getResponseHeader('Expires'));
|
|
237
257
|
} else {
|
|
238
|
-
|
|
258
|
+
const body = new Blob([xhr.response], {type: xhr.getResponseHeader('Content-Type')});
|
|
259
|
+
callback(new AJAXError(xhr.status, xhr.statusText, requestParameters.url, body));
|
|
239
260
|
}
|
|
240
261
|
};
|
|
241
262
|
xhr.send(requestParameters.body);
|
|
@@ -277,8 +298,8 @@ export const getJSON = function(requestParameters: RequestParameters, callback:
|
|
|
277
298
|
};
|
|
278
299
|
|
|
279
300
|
export const getArrayBuffer = function(
|
|
280
|
-
|
|
281
|
-
|
|
301
|
+
requestParameters: RequestParameters,
|
|
302
|
+
callback: ResponseCallback<ArrayBuffer>
|
|
282
303
|
): Cancelable {
|
|
283
304
|
return makeRequest(extend(requestParameters, {type: 'arrayBuffer'}), callback);
|
|
284
305
|
};
|
|
@@ -339,8 +360,8 @@ export const resetImageRequestQueue = () => {
|
|
|
339
360
|
resetImageRequestQueue();
|
|
340
361
|
|
|
341
362
|
export const getImage = function(
|
|
342
|
-
|
|
343
|
-
|
|
363
|
+
requestParameters: RequestParameters,
|
|
364
|
+
callback: Callback<HTMLImageElement | ImageBitmap>
|
|
344
365
|
): Cancelable {
|
|
345
366
|
if (webpSupported.supported) {
|
|
346
367
|
if (!requestParameters.headers) {
|
package/src/util/browser.ts
CHANGED
|
@@ -6,7 +6,7 @@ import classifyRings from './classify_rings';
|
|
|
6
6
|
import Point from '@mapbox/point-geometry';
|
|
7
7
|
|
|
8
8
|
// Load a fill feature from fixture tile.
|
|
9
|
-
const vt = new VectorTile(new Protobuf(fs.readFileSync(path.resolve(__dirname, '../../test/
|
|
9
|
+
const vt = new VectorTile(new Protobuf(fs.readFileSync(path.resolve(__dirname, '../../test/unit/assets/mbsv5-6-18-23.vector.pbf'))));
|
|
10
10
|
const feature = vt.layers.water.feature(0);
|
|
11
11
|
|
|
12
12
|
describe('classifyRings', () => {
|
package/src/util/color_ramp.ts
CHANGED
|
@@ -5,11 +5,11 @@ import assert from 'assert';
|
|
|
5
5
|
import type {StylePropertyExpression} from '../style-spec/expression/index';
|
|
6
6
|
|
|
7
7
|
export type ColorRampParams = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
expression: StylePropertyExpression;
|
|
9
|
+
evaluationKey: string;
|
|
10
|
+
resolution?: number;
|
|
11
|
+
image?: RGBAImage;
|
|
12
|
+
clips?: Array<any>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
package/src/util/config.ts
CHANGED