Skip to content

Commit fafc343

Browse files
Add updateable support for GeoJSON-VT (#7172)
* experimental updateable * comment * result, filter, example * tests - use spread syntax * brainstorm cluster update * pass cluster boolean * filter predicate * request data * total disaster * Updateable geojsonvt non experimental (#7176) * Remove experimental * Reduce diff * Code simplification * Remove parameters from getdata * Fix test * Fix tests * Bring back commented out code * Fix lint * Remove getData * Remove supercluster types, update bundle json * Fix hardcoded clip start and end parameters * This time for real. * Fix missing cluster options, add image. * Use defines from geojson-vt package. * image, changelog * demo code reviews * getData and test * hardcode updateable * misc changes * Addmore test coverage * Fix lint --------- Co-authored-by: wayofthefuture <wayofthefuture@users.noreply.github.com> Co-authored-by: Harel M <harel.mazor@gmail.com>
1 parent 0912f0f commit fafc343

File tree

15 files changed

+374
-378
lines changed

15 files changed

+374
-378
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
### ✨ Features and improvements
44
- Add Etag unmodified support to optimize vector tile reloading ([#7074](https://github.com/maplibre/maplibre-gl-js/pull/7074)) (by [@rivkamatan](https://github.com/rivkamatan and [@wayofthefuture](https://github.com/wayofthefuture))
5-
- _...Add new stuff here..._
65
- Add `boxZoom.boxZoomEnd` option to customize the action after Shift-drag box selection ([#6397](https://github.com/maplibre/maplibre-gl-js/issues/6397))
6+
- Add updateable support for GeoJSON-VT ([#7172](https://github.com/maplibre/maplibre-gl-js/issues/7172)) (by [@wayofthefuture](https://github.com/wayofthefuture) and [HarelM](https://github.com/HarelM))
7+
- _...Add new stuff here..._
78

89
### 🐞 Bug fixes
910
- _...Add new stuff here..._
125 KB
Loading

package-lock.json

Lines changed: 14 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,24 @@
1717
"types": "dist/maplibre-gl.d.ts",
1818
"type": "module",
1919
"dependencies": {
20-
"@mapbox/geojson-rewind": "^0.5.2",
2120
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
2221
"@mapbox/point-geometry": "^1.1.0",
2322
"@mapbox/tiny-sdf": "^2.0.7",
2423
"@mapbox/unitbezier": "^0.0.1",
2524
"@mapbox/vector-tile": "^2.0.4",
2625
"@mapbox/whoots-js": "^3.1.0",
27-
"@maplibre/geojson-vt": "^5.0.4",
26+
"@maplibre/geojson-vt": "^6.0.1",
2827
"@maplibre/maplibre-gl-style-spec": "^24.6.0",
2928
"@maplibre/mlt": "^1.1.6",
3029
"@maplibre/vt-pbf": "^4.3.0",
3130
"@types/geojson": "^7946.0.16",
32-
"@types/supercluster": "^7.1.3",
3331
"earcut": "^3.0.2",
3432
"gl-matrix": "^3.4.4",
3533
"kdbush": "^4.0.2",
3634
"murmurhash-js": "^1.0.0",
3735
"pbf": "^4.0.1",
3836
"potpack": "^2.1.0",
3937
"quickselect": "^3.0.0",
40-
"supercluster": "^8.0.1",
4138
"tinyqueue": "^3.0.0"
4239
},
4340
"devDependencies": {

src/data/bucket/line_bucket.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {LineLayoutArray, LineExtLayoutArray} from '../array_types.g';
2-
2+
import {GEOJSONVT_CLIP_END, GEOJSONVT_CLIP_START} from '@maplibre/geojson-vt';
33
import {members as layoutAttributes} from './line_attributes';
44
import {members as layoutAttributesExt} from './line_attributes_ext';
55
import {SegmentVector} from '../segment';
@@ -12,6 +12,7 @@ import {hasPattern, addPatternDependencies} from './pattern_bucket_features';
1212
import {loadGeometry} from '../load_geometry';
1313
import {toEvaluationFeature} from '../evaluation_feature';
1414
import {EvaluationParameters} from '../../style/evaluation_parameters';
15+
import {subdivideVertexLine} from '../../render/subdivision';
1516

1617
import type {CanonicalTileID} from '../../tile/tile_id';
1718
import type {
@@ -24,16 +25,15 @@ import type {
2425
import type {LineStyleLayer} from '../../style/style_layer/line_style_layer';
2526
import type Point from '@mapbox/point-geometry';
2627
import type {Segment} from '../segment';
27-
import {type RGBAImage} from '../../util/image';
28+
import type {RGBAImage} from '../../util/image';
2829
import type {Context} from '../../gl/context';
2930
import type {Texture} from '../../render/texture';
3031
import type {IndexBuffer} from '../../gl/index_buffer';
3132
import type {VertexBuffer} from '../../gl/vertex_buffer';
3233
import type {FeatureStates} from '../../source/source_state';
3334
import type {ImagePosition} from '../../render/image_atlas';
34-
import {subdivideVertexLine} from '../../render/subdivision';
3535
import type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';
36-
import {type DashEntry} from '../../render/line_atlas';
36+
import type {DashEntry} from '../../render/line_atlas';
3737
import type {VectorTileLayerLike} from '@maplibre/vt-pbf';
3838

3939
// NOTE ON EXTRUDE SCALE:
@@ -247,9 +247,9 @@ export class LineBucket implements Bucket {
247247
}
248248

249249
lineFeatureClips(feature: BucketFeature): LineClips | undefined {
250-
if (!!feature.properties && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_start') && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_end')) {
251-
const start = +feature.properties['mapbox_clip_start'];
252-
const end = +feature.properties['mapbox_clip_end'];
250+
if (!!feature.properties && Object.prototype.hasOwnProperty.call(feature.properties, GEOJSONVT_CLIP_START) && Object.prototype.hasOwnProperty.call(feature.properties, GEOJSONVT_CLIP_END)) {
251+
const start = +feature.properties[GEOJSONVT_CLIP_START];
252+
const end = +feature.properties[GEOJSONVT_CLIP_END];
253253
return {start, end};
254254
}
255255
}

0 commit comments

Comments
 (0)