Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to typescript #209

Merged
merged 149 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
cf52cc9
Update README.md
HarelM Jul 14, 2021
b5035a3
Initial commit - only rename and flow to typescript conversion
HarelM Jul 16, 2021
5f29228
Iint upgrade
HarelM Jul 16, 2021
36712e2
More lint fixes
HarelM Jul 16, 2021
c309e60
Updated lint command, added build typescript command
HarelM Jul 17, 2021
10876d9
Add non typed modules according to ts fork.
HarelM Jul 17, 2021
3f9310a
Switch from yarn to npm
wipfli Jul 17, 2021
ecfef62
Fix hasOwnProperty lint errors
Jul 17, 2021
0959b04
Fix extension from .js to .ts
Jul 17, 2021
33bb386
Remove types file
Jul 17, 2021
fa2b6ea
Ignore lint errors
Jul 17, 2021
a24a7ca
Remove .ts extension in import
Jul 17, 2021
9d8d47d
Update CI from node v10 to v14
HarelM Jul 13, 2021
19dd308
Replace yarn with npm
Jul 17, 2021
d2e3002
Remove circleci
Jul 17, 2021
93c3993
Fixed some typings errors
HarelM Jul 17, 2021
1116842
Explicitly convert matrix-gl types
Jul 18, 2021
c26511e
Automatically fix lint errors
Jul 18, 2021
42ddfe2
Avoid Function as callback type
Jul 18, 2021
5acb66c
Add missing MapOptions
Jul 18, 2021
99e90b8
Add pitchWithRotate to MapOptions and pass explicit options to Handle…
Jul 18, 2021
ff234e6
Set type of MapOptions.style to StyleSpecification of string
Jul 18, 2021
dbbefae
Make Camera an abstract class
Jul 18, 2021
9f653ee
Use Float32Array instead of Float64Array and cast types
Jul 18, 2021
d52ab71
Make object dynamically extendable
Jul 18, 2021
9a62b51
Make more objects dynamically extenable
Jul 18, 2021
4963f15
Explicit cast of array to length 2
Jul 18, 2021
5ca6493
Do not provide type any in for..in loop
Jul 18, 2021
b1e81ab
Make more objects dynamically extenable
Jul 18, 2021
59bdc8b
Cast layout.get return value to Number
Jul 18, 2021
e7bafda
Cast number | void to number
Jul 18, 2021
bcebaca
Specify Rect type
Jul 18, 2021
3199286
Make thhird argument of getKey optional
Jul 18, 2021
9fe8cf6
Cast number | void to number
Jul 18, 2021
4e72829
Define return type of parse() in subclasses of Expression
Jul 18, 2021
95781ad
Cast return type of context.error() from void to null
Jul 18, 2021
efc4b1f
Cast style-spec types to Type
Jul 18, 2021
f0a3c36
Cast return type of context.error() from void to null
Jul 18, 2021
4af74a6
Cast style-spec types to Type
Jul 18, 2021
948a035
Cast dict to StylePropertySpecification
Jul 18, 2021
dbae218
Specify array type as any to fix string[] inference
Jul 18, 2021
f8052f9
Make third argument of coalesce() optional
Jul 18, 2021
fb14039
Explicit casts to Evaluate, Varargs, and Signature
Jul 18, 2021
1783d6a
Revert "Cast style-spec types to Type"
Jul 18, 2021
89bee09
Revert "Cast style-spec types to Type"
Jul 18, 2021
a4a60a6
Cast style-spec types at their source
Jul 18, 2021
08ddb2c
Typescript: Remove @mapbox/geojson-types and replace with @types/GeoJ…
chippieTV Jul 23, 2021
6e966bd
add type to import GLSL as strings (#222)
chippieTV Jul 23, 2021
0e57cf8
Typescript: Use library to handle Window type (#223)
chippieTV Jul 23, 2021
7bb152f
Fix issues related to possibly evaluated design
HarelM Jul 24, 2021
c2c5b91
Move IControl interface to a new class, Fix timeoutID type.
HarelM Jul 24, 2021
33b3f49
remove flow-typed folder (#225)
chippieTV Jul 25, 2021
9aff296
Typescript: Remove reference to @mapbox/point-geometry TBC (#226)
chippieTV Jul 25, 2021
d7c7af3
Fix lint
HarelM Jul 25, 2021
4c6d8e7
Typescript: fix lint and update .eslintrc with alternate TS rule (#227)
chippieTV Jul 25, 2021
ac94146
Typescript: a number of minor fixes from WIP branch (#228)
chippieTV Jul 25, 2021
eafe46c
Fix small typings issues
HarelM Jul 25, 2021
0306da0
More typescript fixes
HarelM Jul 25, 2021
139726f
More fixes to typings, lint fixes
HarelM Jul 25, 2021
58eecb5
Change base calls to be abstract
HarelM Jul 25, 2021
e633436
More type fixes
HarelM Jul 26, 2021
9fd964e
More types fixes
HarelM Jul 26, 2021
a4ede9a
More types fixes
HarelM Jul 26, 2021
c48e970
update use of mat4 (#219)
chippieTV Jul 26, 2021
8f18665
Added some "as any" to places in the code where the typing were not j…
HarelM Jul 26, 2021
3e5768e
More types fixing, not perfect but good enough.
HarelM Jul 27, 2021
e2ee96f
Fix last typescript errors
HarelM Jul 27, 2021
a34f64b
Fix incorrect typings and code errors.
HarelM Jul 27, 2021
bd32057
Remove flow from rollup and add tsc to build
HarelM Jul 27, 2021
78a62c9
Format file
HarelM Jul 27, 2021
2710e4b
Fix rollup build
HarelM Jul 27, 2021
a963b6e
Initial commit to make the render test run
HarelM Jul 30, 2021
eb1ace7
Remove unneeded window import from all files
HarelM Jul 30, 2021
056a396
Remove version from API
HarelM Jul 30, 2021
a875ae6
More mock fixes to be able to run tests
HarelM Jul 30, 2021
63e17ce
fix running of test-expression (#232)
chippieTV Jul 31, 2021
a68ea80
Add build phase before running some of the tests
HarelM Jul 31, 2021
8e44d82
Fix tests get stuck, still tests are failing...
HarelM Jul 31, 2021
e0c7f89
get node query tests running (#233)
chippieTV Jul 31, 2021
70938ed
Fix mocking of case of tilejson implementation.
HarelM Jul 31, 2021
3a1c788
Typescript: Fix unit-tests (#235)
HarelM Aug 3, 2021
7978d04
Incorrect invocation of build-dev...
HarelM Aug 3, 2021
e2bced5
Fix lint errors
HarelM Aug 3, 2021
6046b61
Removed test flow
HarelM Aug 3, 2021
8f11ef3
Fix build csp, started to fix style build
HarelM Aug 4, 2021
0aae94b
Fix css build
HarelM Aug 4, 2021
c15469f
Remove to vec3 as to code review requirements
HarelM Aug 4, 2021
598d3d6
Remove flow from build in ci
HarelM Aug 4, 2021
24f374e
Remove references to @mapbox/point-geometry
HarelM Aug 4, 2021
baabb53
Allow building style-spec
HarelM Aug 4, 2021
79e4754
Fix build tests
HarelM Aug 4, 2021
f8208b3
Remove window, fix missing references to FeatureIndex using typescrip…
HarelM Aug 6, 2021
24e2c8f
Fix lint
HarelM Aug 6, 2021
3cee03e
Fix production build
HarelM Aug 6, 2021
e3eefb2
Remove buble, stop compiling for es5
HarelM Aug 6, 2021
f05202f
Added missing global definitions after removing window
HarelM Aug 6, 2021
784e23d
Fix tests, bring back web_worker mock file, fix maplibre-gl loading i…
HarelM Aug 7, 2021
6610b95
Fix build?
HarelM Aug 8, 2021
4db2629
Fix lint
HarelM Aug 8, 2021
1d76444
Typescript: Fix query-tests (#240)
HarelM Aug 8, 2021
140ad58
Fix some lint issues
HarelM Aug 8, 2021
c730494
Typescript: minor fixes to formatting (#241)
chippieTV Aug 9, 2021
4bccaaf
Remove unneeded comments
HarelM Aug 9, 2021
49411c6
Fix according to code review
HarelM Aug 9, 2021
532640a
Remove undefined as any
HarelM Aug 9, 2021
58ee617
Fix according to code review requirements.
HarelM Aug 9, 2021
6d0feff
Fix lint
HarelM Aug 9, 2021
debca9f
More lint cover and fixes
HarelM Aug 9, 2021
f7a2905
Fix lint for windows, update versions.
HarelM Aug 9, 2021
1d8e3f7
Fix browser tests due to incorrect lint fix
HarelM Aug 9, 2021
c86a14f
Fix lint for land.html
HarelM Aug 9, 2021
2c55e69
Fix minimal node version to 14
HarelM Aug 12, 2021
3b489d2
Typescript: merge from main (#243)
astridx Aug 14, 2021
0db9613
Merge branch 'main' into typescript
astridx Aug 15, 2021
27ce223
Update Life of a tile docs (#247)
astridx Aug 17, 2021
fdfb04d
Merge branch 'main' into typescript
astridx Aug 17, 2021
44c11ed
Update package.json (#248)
astridx Aug 18, 2021
708b7a0
Merge branch 'main' into typescript
astridx Aug 20, 2021
7d4192b
some updates from review (#252)
chippieTV Aug 25, 2021
f7ba71a
Fix WritingMode cast (#254)
wipfli Aug 25, 2021
41dae49
Run CI on all pull requests (#255)
wipfli Aug 28, 2021
83a69c3
Remove redundant parentheses (#257)
wipfli Aug 28, 2021
c5840a8
Remove (minify = false)
HarelM Aug 28, 2021
9db4f31
Merge branch 'typescript' of https://github.com/maplibre/maplibre-gl-…
HarelM Aug 28, 2021
6daaf50
Review cleanup (#259)
wipfli Aug 28, 2021
42ba236
Remove TODO, Fix according to code review changes
HarelM Aug 28, 2021
c6eed6c
Merge branch 'typescript' of https://github.com/maplibre/maplibre-gl-…
HarelM Aug 28, 2021
eebf172
Remove last TODOs.
HarelM Aug 28, 2021
78e1075
Updated changelog
HarelM Aug 28, 2021
0e569bc
Change publish style spec to reflect latest changes in typescript
HarelM Aug 28, 2021
f8dcc8d
Fix code review comments
HarelM Aug 28, 2021
db2bed5
Declare `emplace()` with variable number of arguments (#262)
wipfli Aug 28, 2021
75e6173
Fix comment of generated files
HarelM Aug 28, 2021
57c3545
Merge branch 'typescript' of https://github.com/maplibre/maplibre-gl-…
HarelM Aug 28, 2021
5f75b61
Fix according to code review
HarelM Aug 29, 2021
6a8559e
remove comment and update type in jsdoc (#269)
chippieTV Aug 29, 2021
c680068
Copy dist folder with `cp -r` (#274)
wipfli Aug 29, 2021
fd29d6c
Fix typo
wipfli Aug 29, 2021
343353e
Fix last comments about generated files.
HarelM Aug 29, 2021
84f118d
Merge branch 'typescript' of https://github.com/maplibre/maplibre-gl-…
HarelM Aug 29, 2021
7d9af25
Fix typos in comments (#283)
fredj Aug 31, 2021
7b126e1
Remove polyfill support for IE11 (#284)
fredj Aug 31, 2021
fa05f55
Enforce semicolons as member delimters (#282)
drwestco Aug 31, 2021
b6ac656
eslint - enforce single quotes (#285)
drwestco Aug 31, 2021
e0f7062
move point.ts from symbol/ to util/ (#287)
chippieTV Sep 1, 2021
148e23a
Remove undefined as any casts (#292)
drwestco Sep 1, 2021
87e555c
Remove feature detection for {passive: false} support (#291)
fredj Sep 1, 2021
de752a0
Changed version in package.json before merge
HarelM Sep 3, 2021
8d789b7
Remove the usage of devicePixelRatio as a getter from browser.ts (#294)
fredj Sep 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Use MapLibre GL JS bindings for React (https://visgl.github.io/react-map-gl/docs

### Roadmap

Migrate to typescript

This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and backwards-compatability with previous releases and continued bug-fixes and maintenance going forward.

### Getting Involved
Expand Down
2 changes: 0 additions & 2 deletions src/data/array_types.js → src/data/array_types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// This file is generated. Edit build/generate-struct-arrays.js, then run `yarn run codegen`.
// @flow

import assert from 'assert';
import {Struct, StructArray} from '../util/struct_array';
import {register} from '../util/web_worker_transfer';
Expand Down
118 changes: 66 additions & 52 deletions src/data/bucket.js → src/data/bucket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @flow

import type {CollisionBoxArray} from './array_types';
import type { CollisionBoxArray } from './array_types';
import type Style from '../style/style';
import type {TypedStyleLayer} from '../style/style_layer/typed_style_layer';
import type FeatureIndex from './feature_index';
Expand All @@ -9,42 +7,48 @@ import type {FeatureStates} from '../source/source_state';
import type {ImagePosition} from '../render/image_atlas';
import type {CanonicalTileID} from '../source/tile_id';

export type BucketParameters<Layer: TypedStyleLayer> = {
index: number,
layers: Array<Layer>,
zoom: number,
pixelRatio: number,
overscaling: number,
collisionBoxArray: CollisionBoxArray,
sourceLayerIndex: number,
sourceID: string
}
export type BucketParameters<Layer extends TypedStyleLayer> = {
index: number,
layers: Array<Layer>,
zoom: number,
pixelRatio: number,
overscaling: number,
collisionBoxArray: CollisionBoxArray,
sourceLayerIndex: number,
sourceID: string
};

export type PopulateParameters = {
featureIndex: FeatureIndex,
iconDependencies: {},
patternDependencies: {},
glyphDependencies: {},
availableImages: Array<string>
}
featureIndex: FeatureIndex,
iconDependencies: {},
patternDependencies: {},
glyphDependencies: {},
availableImages: Array<string>
};

export type IndexedFeature = {
feature: VectorTileFeature,
id: number | string,
index: number,
sourceLayerIndex: number,
}
feature: VectorTileFeature,
id: number | string,
index: number,
sourceLayerIndex: number
};

export type BucketFeature = {|
index: number,
sourceLayerIndex: number,
geometry: Array<Array<Point>>,
properties: Object,
type: 1 | 2 | 3,
id?: any,
+patterns: {[_: string]: {"min": string, "mid": string, "max": string}},
sortKey?: number
|};
export type BucketFeature = {
index: number,
sourceLayerIndex: number,
geometry: Array<Array<Point>>,
properties: any,
type: 1 | 2 | 3,
id?: any,
readonly patterns: {
[_: string]: {
"min": string,
"mid": string,
"max": string
}
},
sortKey?: number
};

/**
* The `Bucket` interface is the single point of knowledge about turning vector
Expand All @@ -70,29 +74,39 @@ export type BucketFeature = {|
* @private
*/
export interface Bucket {
layerIds: Array<string>;
hasPattern: boolean;
+layers: Array<any>;
+stateDependentLayers: Array<any>;
+stateDependentLayerIds: Array<string>;
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}): void;
isEmpty(): boolean;

upload(context: Context): void;
uploadPending(): boolean;

/**
layerIds: Array<string>;
hasPattern: boolean;
readonly layers: Array<any>;
readonly stateDependentLayers: Array<any>;
readonly stateDependentLayerIds: Array<string>;
populate(
features: Array<IndexedFeature>,
options: PopulateParameters,
canonical: CanonicalTileID
): void;
HarelM marked this conversation as resolved.
Show resolved Hide resolved
update(
states: FeatureStates,
vtLayer: VectorTileLayer,
imagePositions: {
[_: string]: ImagePosition
}
): void;
isEmpty(): boolean;
upload(context: Context): void;
uploadPending(): boolean;
/**
* Release the WebGL resources associated with the buffers. Note that because
* buckets are shared between layers having the same layout properties, they
* must be destroyed in groups (all buckets for a tile, or all symbol buckets).
*
* @private
*/
destroy(): void;
destroy(): void;
HarelM marked this conversation as resolved.
Show resolved Hide resolved
}

export function deserialize(input: Array<Bucket>, style: Style): {[_: string]: Bucket} {
export function deserialize(input: Array<Bucket>, style: Style): {
[_: string]: Bucket
} {
HarelM marked this conversation as resolved.
Show resolved Hide resolved
const output = {};

// Guard against the case where the map's style has been set to null while
Expand All @@ -110,9 +124,9 @@ export function deserialize(input: Array<Bucket>, style: Style): {[_: string]: B

// look up StyleLayer objects from layer ids (since we don't
// want to waste time serializing/copying them from the worker)
(bucket: any).layers = layers;
if ((bucket: any).stateDependentLayerIds) {
(bucket: any).stateDependentLayers = (bucket: any).stateDependentLayerIds.map((lId) => layers.filter((l) => l.id === lId)[0]);
(bucket as any).layers = layers;
wipfli marked this conversation as resolved.
Show resolved Hide resolved
if ((bucket as any).stateDependentLayerIds) {
(bucket as any).stateDependentLayers = (bucket as any).stateDependentLayerIds.map((lId) => layers.filter((l) => l.id === lId)[0]);
}
for (const layer of layers) {
output[layer.id] = bucket;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import {createLayout} from '../../util/struct_array';
import { createLayout } from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @flow

import {CircleLayoutArray} from '../array_types';
import { CircleLayoutArray } from '../array_types';

import {members as layoutAttributes} from './circle_attributes';
import SegmentVector from '../segment';
Expand Down Expand Up @@ -42,7 +40,7 @@ function addCircleVertex(layoutVertexArray, x, y, extrudeX, extrudeY) {
* vector that is where it points.
* @private
*/
class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucket {
class CircleBucket<Layer extends CircleStyleLayer | HeatmapStyleLayer> implements Bucket {
index: number;
zoom: number;
overscaling: number;
Expand Down Expand Up @@ -85,7 +83,7 @@ class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucke

// Heatmap layers are handled in this bucket and have no evaluated properties, so we check our access
if (styleLayer.type === 'circle') {
circleSortKey = ((styleLayer: any): CircleStyleLayer).layout.get('circle-sort-key');
circleSortKey = (styleLayer as any as CircleStyleLayer).layout.get('circle-sort-key');
sortFeaturesByKey = !circleSortKey.isConstant();
}

Expand Down Expand Up @@ -118,7 +116,7 @@ class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucke
if (sortFeaturesByKey) {
bucketFeatures.sort((a, b) => {
// a.sortKey is always a number when in use
return ((a.sortKey: any): number) - ((b.sortKey: any): number);
return (a.sortKey as any as number) - (b.sortKey as any as number);
HarelM marked this conversation as resolved.
Show resolved Hide resolved
});
}

Expand All @@ -131,7 +129,9 @@ class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucke
}
}

update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition
}) {
if (!this.stateDependentLayers.length) return;
this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import {createLayout} from '../../util/struct_array';
import { createLayout } from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'}
Expand Down
18 changes: 11 additions & 7 deletions src/data/bucket/fill_bucket.js → src/data/bucket/fill_bucket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @flow

import {FillLayoutArray} from '../array_types';
import { FillLayoutArray } from '../array_types';

import {members as layoutAttributes} from './fill_attributes';
import SegmentVector from '../segment';
Expand Down Expand Up @@ -108,7 +106,7 @@ class FillBucket implements Bucket {
if (sortFeaturesByKey) {
bucketFeatures.sort((a, b) => {
// a.sortKey is always a number when in use
return ((a.sortKey: any): number) - ((b.sortKey: any): number);
return (a.sortKey as any as number) - (b.sortKey as any as number);
});
}

Expand All @@ -129,12 +127,16 @@ class FillBucket implements Bucket {
}
}

update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition
}) {
wipfli marked this conversation as resolved.
Show resolved Hide resolved
if (!this.stateDependentLayers.length) return;
this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);
}

addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {
addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition
}) {
wipfli marked this conversation as resolved.
Show resolved Hide resolved
for (const feature of this.patternFeatures) {
this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions);
}
Expand Down Expand Up @@ -167,7 +169,9 @@ class FillBucket implements Bucket {
this.segments2.destroy();
}

addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition
}) {
wipfli marked this conversation as resolved.
Show resolved Hide resolved
for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {
let numVertices = 0;
for (const ring of polygon) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import {createLayout} from '../../util/struct_array';
import { createLayout } from '../../util/struct_array';

const layout = createLayout([
{name: 'a_pos', components: 2, type: 'Int16'},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @flow

import {FillExtrusionLayoutArray} from '../array_types';
import { FillExtrusionLayoutArray } from '../array_types';

import {members as layoutAttributes} from './fill_extrusion_attributes';
import SegmentVector from '../segment';
Expand Down Expand Up @@ -119,14 +117,18 @@ class FillExtrusionBucket implements Bucket {
}
}

addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {
addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition
}) {
for (const feature of this.features) {
const {geometry} = feature;
this.addFeature(feature, geometry, feature.index, canonical, imagePositions);
}
}

update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition
}) {
if (!this.stateDependentLayers.length) return;
this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);
}
Expand Down Expand Up @@ -156,7 +158,9 @@ class FillExtrusionBucket implements Bucket {
this.segments.destroy();
}

addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition
}) {
HarelM marked this conversation as resolved.
Show resolved Hide resolved
for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {
let numVertices = 0;
for (const ring of polygon) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow

import CircleBucket from './circle_bucket';

import {register} from '../../util/web_worker_transfer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import {createLayout} from '../../util/struct_array';
import { createLayout } from '../../util/struct_array';

const lineLayoutAttributes = createLayout([
{name: 'a_pos_normal', components: 2, type: 'Int16'},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @flow
import {createLayout} from '../../util/struct_array';
import { createLayout } from '../../util/struct_array';

const lineLayoutAttributesExt = createLayout([
{name: 'a_uv_x', components: 1, type: 'Float32'},
Expand Down
Loading