maplibre-gl 2.0.2 → 2.0.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/generate-struct-arrays.ts +1 -1
- package/build/post-ts-build.js +0 -9
- package/build/release-notes.js +7 -32
- package/dist/maplibre-gl.d.ts +8 -204
- package/dist/maplibre-gl.js +4 -4
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +14 -11
- package/src/data/array_types.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/data/bucket/symbol_bucket.ts +1 -1
- package/src/data/bucket.ts +1 -1
- package/src/data/evaluation_feature.ts +1 -1
- package/src/data/feature_index.ts +1 -1
- package/src/data/load_geometry.ts +1 -1
- package/src/geo/edge_insets.ts +1 -1
- package/src/geo/transform.test.ts +1 -1
- package/src/geo/transform.ts +1 -1
- package/src/index.ts +1 -1
- package/src/render/draw_symbol.ts +1 -1
- package/src/source/geojson_source.test.ts +27 -0
- package/src/source/geojson_source.ts +1 -3
- package/src/source/geojson_wrapper.ts +1 -1
- package/src/source/query_features.test.ts +1 -1
- package/src/source/query_features.ts +1 -1
- package/src/source/source_cache.test.ts +1 -1
- package/src/source/source_cache.ts +1 -1
- package/src/source/tile.ts +1 -1
- package/src/source/tile_id.ts +1 -1
- package/src/source/vector_tile_worker_source.test.ts +306 -0
- package/src/style/query_utils.ts +1 -1
- package/src/style/style_layer/circle_style_layer.ts +1 -1
- package/src/style/style_layer/fill_extrusion_style_layer.ts +1 -1
- package/src/style/style_layer/fill_style_layer.ts +1 -1
- package/src/style/style_layer/line_style_layer.ts +1 -1
- package/src/style/style_layer.ts +1 -1
- package/src/style-spec/expression/index.ts +1 -1
- package/src/style-spec/feature_filter/feature_filter.test.ts +1 -1
- package/src/style-spec/migrate.test.ts +112 -0
- package/src/style-spec/style-spec.ts +0 -3
- package/src/style-spec/validate_spec.test.ts +29 -0
- package/src/symbol/anchor.ts +1 -1
- package/src/symbol/check_max_angle.test.ts +1 -1
- package/src/symbol/check_max_angle.ts +1 -1
- package/src/symbol/clip_line.test.ts +1 -1
- package/src/symbol/clip_line.ts +1 -1
- package/src/symbol/collision_feature.test.ts +1 -1
- package/src/symbol/collision_feature.ts +1 -1
- package/src/symbol/collision_index.ts +1 -1
- package/src/symbol/get_anchors.test.ts +1 -1
- package/src/symbol/get_anchors.ts +1 -1
- package/src/symbol/mergelines.test.ts +1 -1
- package/src/symbol/path_interpolator.test.ts +1 -1
- package/src/symbol/path_interpolator.ts +1 -1
- package/src/symbol/placement.ts +1 -1
- package/src/symbol/projection.ts +1 -1
- package/src/symbol/quads.ts +1 -1
- package/src/symbol/symbol_layout.ts +1 -1
- package/src/ui/camera.test.ts +0 -8
- package/src/ui/camera.ts +5 -3
- package/src/ui/control/navigation_control.ts +1 -1
- package/src/ui/events.ts +1 -1
- package/src/ui/handler/box_zoom.ts +1 -1
- package/src/ui/handler/click_zoom.ts +1 -1
- package/src/ui/handler/handler_util.ts +1 -1
- package/src/ui/handler/map_event.ts +1 -1
- package/src/ui/handler/mouse.ts +1 -1
- package/src/ui/handler/scroll_zoom.ts +1 -1
- package/src/ui/handler/tap_drag_zoom.ts +1 -1
- package/src/ui/handler/tap_recognizer.ts +1 -1
- package/src/ui/handler/tap_zoom.ts +1 -1
- package/src/ui/handler/touch_pan.ts +1 -1
- package/src/ui/handler/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler_inertia.ts +1 -1
- package/src/ui/handler_manager.ts +1 -1
- package/src/ui/map.ts +2 -2
- package/src/ui/marker.test.ts +1 -1
- package/src/ui/marker.ts +2 -1
- package/src/ui/popup.test.ts +1 -1
- package/src/ui/popup.ts +2 -2
- package/src/util/classify_rings.test.ts +1 -1
- package/src/util/classify_rings.ts +1 -1
- package/src/util/dom.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.test.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.ts +1 -1
- package/src/util/intersection_tests.ts +1 -1
- package/src/util/smart_wrap.ts +1 -1
- package/src/util/util.test.ts +1 -1
- package/src/util/util.ts +1 -1
- package/CHANGELOG.md +0 -2585
- package/dist/package.json +0 -1
- package/src/types/packages-types/vector-tile/index.d.ts +0 -27
- package/src/util/point.ts +0 -349
|
@@ -28,7 +28,7 @@ import type {ImagePosition} from '../render/image_atlas';
|
|
|
28
28
|
import type {GlyphPosition} from '../render/glyph_atlas';
|
|
29
29
|
import type {PossiblyEvaluatedPropertyValue} from '../style/properties';
|
|
30
30
|
|
|
31
|
-
import Point from '
|
|
31
|
+
import Point from '@mapbox/point-geometry';
|
|
32
32
|
import murmur3 from 'murmurhash-js';
|
|
33
33
|
|
|
34
34
|
// The symbol layout process needs `text-size` evaluated at up to five different zoom levels, and
|
package/src/ui/camera.test.ts
CHANGED
|
@@ -1777,14 +1777,6 @@ describe('#cameraForBounds', () => {
|
|
|
1777
1777
|
expect(fixedLngLat(transform.center, 4)).toEqual({lng: -100.5, lat: 44.4717});
|
|
1778
1778
|
});
|
|
1779
1779
|
|
|
1780
|
-
test('offset as object', () => {
|
|
1781
|
-
const camera = createCamera();
|
|
1782
|
-
const bb = [[-133, 16], [-68, 50]];
|
|
1783
|
-
const transform = camera.cameraForBounds(bb, {offset: {x: 0, y: 100}});
|
|
1784
|
-
|
|
1785
|
-
expect(fixedLngLat(transform.center, 4)).toEqual({lng: -100.5, lat: 44.4717});
|
|
1786
|
-
});
|
|
1787
|
-
|
|
1788
1780
|
test('offset and padding', () => {
|
|
1789
1781
|
const camera = createCamera();
|
|
1790
1782
|
const bb = [[-133, 16], [-68, 50]];
|
package/src/ui/camera.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {number as interpolate} from '../style-spec/util/interpolate';
|
|
|
3
3
|
import browser from '../util/browser';
|
|
4
4
|
import LngLat from '../geo/lng_lat';
|
|
5
5
|
import LngLatBounds from '../geo/lng_lat_bounds';
|
|
6
|
-
import Point
|
|
6
|
+
import Point from '@mapbox/point-geometry';
|
|
7
7
|
import {Event, Evented} from '../util/evented';
|
|
8
8
|
import assert from 'assert';
|
|
9
9
|
import {Debug} from '../util/debug';
|
|
@@ -14,6 +14,8 @@ import type {LngLatBoundsLike} from '../geo/lng_lat_bounds';
|
|
|
14
14
|
import type {TaskID} from '../util/task_queue';
|
|
15
15
|
import type {PaddingOptions} from '../geo/edge_insets';
|
|
16
16
|
|
|
17
|
+
export type PointLike = Point | [number, number];
|
|
18
|
+
|
|
17
19
|
export type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>; }[keyof T];
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -599,7 +601,7 @@ abstract class Camera extends Evented {
|
|
|
599
601
|
* @memberof Map#
|
|
600
602
|
* @param bounds Center these bounds in the viewport and use the highest
|
|
601
603
|
* zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.
|
|
602
|
-
* @param {
|
|
604
|
+
* @param {FitBoundsOptions} [options] Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.
|
|
603
605
|
* @param {number | PaddingOptions} [options.padding] The amount of padding in pixels to add to the given bounds.
|
|
604
606
|
* @param {boolean} [options.linear=false] If `true`, the map transitions using
|
|
605
607
|
* {@link Map#easeTo}. If `false`, the map transitions using {@link Map#flyTo}. See
|
|
@@ -955,7 +957,7 @@ abstract class Camera extends Evented {
|
|
|
955
957
|
* unless 'options' includes `essential: true`.
|
|
956
958
|
*
|
|
957
959
|
* @memberof Map#
|
|
958
|
-
* @param {
|
|
960
|
+
* @param {FlyToOptions} options Options describing the destination and animation of the transition.
|
|
959
961
|
* Accepts {@link CameraOptions}, {@link AnimationOptions},
|
|
960
962
|
* and the following additional options.
|
|
961
963
|
* @param {number} [options.curve=1.42] The zooming "curve" that will occur along the
|
package/src/ui/events.ts
CHANGED
|
@@ -3,7 +3,7 @@ import DOM from '../../util/dom';
|
|
|
3
3
|
import {Event} from '../../util/evented';
|
|
4
4
|
|
|
5
5
|
import type Map from '../map';
|
|
6
|
-
import type Point from '
|
|
6
|
+
import type Point from '@mapbox/point-geometry';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {MapMouseEvent, MapTouchEvent, MapWheelEvent} from '../events';
|
|
2
2
|
import {Handler} from '../handler_manager';
|
|
3
3
|
import type Map from '../map';
|
|
4
|
-
import type Point from '
|
|
4
|
+
import type Point from '@mapbox/point-geometry';
|
|
5
5
|
|
|
6
6
|
export class MapEventHandler implements Handler {
|
|
7
7
|
|
package/src/ui/handler/mouse.ts
CHANGED
|
@@ -8,7 +8,7 @@ import LngLat from '../../geo/lng_lat';
|
|
|
8
8
|
|
|
9
9
|
import type Map from '../map';
|
|
10
10
|
import type HandlerManager from '../handler_manager';
|
|
11
|
-
import type Point from '
|
|
11
|
+
import type Point from '@mapbox/point-geometry';
|
|
12
12
|
|
|
13
13
|
// deltaY value for mouse scroll wheel identification
|
|
14
14
|
const wheelZoomDelta = 4.000244140625;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import browser from '../util/browser';
|
|
2
2
|
import type Map from './map';
|
|
3
3
|
import {bezier, clamp, extend} from '../util/util';
|
|
4
|
-
import Point from '
|
|
4
|
+
import Point from '@mapbox/point-geometry';
|
|
5
5
|
import type {DragPanOptions} from './handler/shim/drag_pan';
|
|
6
6
|
|
|
7
7
|
const defaultInertiaOptions = {
|
|
@@ -17,7 +17,7 @@ import DragPanHandler from './handler/shim/drag_pan';
|
|
|
17
17
|
import DragRotateHandler from './handler/shim/drag_rotate';
|
|
18
18
|
import TouchZoomRotateHandler from './handler/shim/touch_zoom_rotate';
|
|
19
19
|
import {bindAll, extend} from '../util/util';
|
|
20
|
-
import Point from '
|
|
20
|
+
import Point from '@mapbox/point-geometry';
|
|
21
21
|
import assert from 'assert';
|
|
22
22
|
|
|
23
23
|
export type InputEvent = MouseEvent | TouchEvent | KeyboardEvent | WheelEvent;
|
package/src/ui/map.ts
CHANGED
|
@@ -12,7 +12,7 @@ import HandlerManager from './handler_manager';
|
|
|
12
12
|
import Camera from './camera';
|
|
13
13
|
import LngLat from '../geo/lng_lat';
|
|
14
14
|
import LngLatBounds from '../geo/lng_lat_bounds';
|
|
15
|
-
import Point
|
|
15
|
+
import Point from '@mapbox/point-geometry';
|
|
16
16
|
import AttributionControl from './control/attribution_control';
|
|
17
17
|
import LogoControl from './control/logo_control';
|
|
18
18
|
import {supported} from '@mapbox/mapbox-gl-supported';
|
|
@@ -33,7 +33,7 @@ import type {StyleOptions, StyleSetterOptions} from '../style/style';
|
|
|
33
33
|
import type {MapEvent, MapDataEvent} from './events';
|
|
34
34
|
import type {CustomLayerInterface} from '../style/style_layer/custom_style_layer';
|
|
35
35
|
import type {StyleImageInterface, StyleImageMetadata} from '../style/style_image';
|
|
36
|
-
|
|
36
|
+
import type {PointLike} from './camera';
|
|
37
37
|
import type ScrollZoomHandler from './handler/scroll_zoom';
|
|
38
38
|
import type BoxZoomHandler from './handler/box_zoom';
|
|
39
39
|
import type {TouchPitchHandler} from './handler/touch_zoom_rotate';
|
package/src/ui/marker.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {createMap as globalCreateMap, setPerformance, setWebGlContext} from '../
|
|
|
2
2
|
import Marker from './marker';
|
|
3
3
|
import Popup from './popup';
|
|
4
4
|
import LngLat from '../geo/lng_lat';
|
|
5
|
-
import Point from '
|
|
5
|
+
import Point from '@mapbox/point-geometry';
|
|
6
6
|
import simulate from '../../test/util/simulate_interaction';
|
|
7
7
|
|
|
8
8
|
function createMap(options = {}) {
|
package/src/ui/marker.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DOM from '../util/dom';
|
|
2
2
|
import LngLat from '../geo/lng_lat';
|
|
3
|
-
import Point
|
|
3
|
+
import Point from '@mapbox/point-geometry';
|
|
4
4
|
import smartWrap from '../util/smart_wrap';
|
|
5
5
|
import {bindAll, extend} from '../util/util';
|
|
6
6
|
import {anchorTranslate, applyAnchorClass} from './anchor';
|
|
@@ -10,6 +10,7 @@ import type Map from './map';
|
|
|
10
10
|
import Popup, {Offset} from './popup';
|
|
11
11
|
import type {LngLatLike} from '../geo/lng_lat';
|
|
12
12
|
import type {MapMouseEvent, MapTouchEvent} from './events';
|
|
13
|
+
import type {PointLike} from './camera';
|
|
13
14
|
|
|
14
15
|
type MarkerOptions = {
|
|
15
16
|
element?: HTMLElement;
|
package/src/ui/popup.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {createMap as globalCreateMap, setPerformance, setWebGlContext} from '../util/test/util';
|
|
2
2
|
import Popup, {Offset} from './popup';
|
|
3
3
|
import LngLat from '../geo/lng_lat';
|
|
4
|
-
import Point from '
|
|
4
|
+
import Point from '@mapbox/point-geometry';
|
|
5
5
|
import simulate from '../../test/util/simulate_interaction';
|
|
6
6
|
import {PositionAnchor} from './anchor';
|
|
7
7
|
|
package/src/ui/popup.ts
CHANGED
|
@@ -3,14 +3,14 @@ import {Event, Evented} from '../util/evented';
|
|
|
3
3
|
import {MapMouseEvent} from '../ui/events';
|
|
4
4
|
import DOM from '../util/dom';
|
|
5
5
|
import LngLat from '../geo/lng_lat';
|
|
6
|
-
import Point
|
|
6
|
+
import Point from '@mapbox/point-geometry';
|
|
7
7
|
import smartWrap from '../util/smart_wrap';
|
|
8
8
|
import {anchorTranslate, applyAnchorClass} from './anchor';
|
|
9
9
|
|
|
10
10
|
import type {PositionAnchor} from './anchor';
|
|
11
|
-
|
|
12
11
|
import type Map from './map';
|
|
13
12
|
import type {LngLatLike} from '../geo/lng_lat';
|
|
13
|
+
import type {PointLike} from './camera';
|
|
14
14
|
|
|
15
15
|
const defaultOptions = {
|
|
16
16
|
closeButton: true,
|
|
@@ -3,7 +3,7 @@ import path from 'path';
|
|
|
3
3
|
import Protobuf from 'pbf';
|
|
4
4
|
import {VectorTile} from '@mapbox/vector-tile';
|
|
5
5
|
import classifyRings from './classify_rings';
|
|
6
|
-
import Point from '
|
|
6
|
+
import Point from '@mapbox/point-geometry';
|
|
7
7
|
|
|
8
8
|
// Load a fill feature from fixture tile.
|
|
9
9
|
const vt = new VectorTile(new Protobuf(fs.readFileSync(path.resolve(__dirname, '../../test/fixtures/mbsv5-6-18-23.vector.pbf'))));
|
|
@@ -2,7 +2,7 @@ import quickselect from 'quickselect';
|
|
|
2
2
|
|
|
3
3
|
import {calculateSignedArea} from './util';
|
|
4
4
|
|
|
5
|
-
import type Point from '
|
|
5
|
+
import type Point from '@mapbox/point-geometry';
|
|
6
6
|
|
|
7
7
|
// classifies an array of rings into polygons with outer rings and holes
|
|
8
8
|
export default function classifyRings(rings: Array<Array<Point>>, maxRings: number) {
|
package/src/util/dom.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {isCounterClockwise} from './util';
|
|
2
2
|
|
|
3
|
-
import Point from '
|
|
3
|
+
import Point from '@mapbox/point-geometry';
|
|
4
4
|
|
|
5
5
|
export {polygonIntersectsBufferedPoint, polygonIntersectsMultiPolygon, polygonIntersectsBufferedMultiLine, polygonIntersectsPolygon, distToSegmentSquared, polygonIntersectsBox};
|
|
6
6
|
|
package/src/util/smart_wrap.ts
CHANGED
package/src/util/util.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {easeCubicInOut, keysDifference, extend, pick, uniqueId, bindAll, asyncAll, clamp, wrap, bezier, mapObject, filterObject, deepEqual, clone, arraysIntersect, isCounterClockwise, isClosedPolygon, parseCacheControl, nextPowerOfTwo, isPowerOfTwo} from './util';
|
|
2
|
-
import Point from '
|
|
2
|
+
import Point from '@mapbox/point-geometry';
|
|
3
3
|
|
|
4
4
|
describe('util', () => {
|
|
5
5
|
expect(easeCubicInOut(0)).toBe(0);
|