Skip to content

Commit

Permalink
lint and flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheem Mamoowala committed Jan 18, 2019
1 parent 671073e commit 826e5c1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/data/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function deserialize(input: Array<Bucket>, style: Style): {[string]: Buck
// 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.find((l) => l.id == lId));
(bucket: any).stateDependentLayers = (bucket: any).stateDependentLayerIds.map((lId) => layers.find((l) => l.id === lId));
}
for (const layer of layers) {
output[layer.id] = bucket;
Expand Down
3 changes: 2 additions & 1 deletion src/data/bucket/circle_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucke
layerIds: Array<string>;
layers: Array<Layer>;
stateDependentLayers: Array<Layer>;
stateDependentLayerIds: Array<string>;

layoutVertexArray: CircleLayoutArray;
layoutVertexBuffer: VertexBuffer;
Expand All @@ -72,7 +73,7 @@ class CircleBucket<Layer: CircleStyleLayer | HeatmapStyleLayer> implements Bucke
this.indexArray = new TriangleIndexArray();
this.segments = new SegmentVector();
this.programConfigurations = new ProgramConfigurationSet(layoutAttributes, options.layers, options.zoom);
this.stateDependentLayerIds = this.layers.filter( (l) => l.isStateDependent()).map((l) => l.id);
this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);

}

Expand Down
3 changes: 2 additions & 1 deletion src/data/bucket/fill_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class FillBucket implements Bucket {
layers: Array<FillStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<FillStyleLayer>;
stateDependentLayerIds: Array<string>;

layoutVertexArray: FillLayoutArray;
layoutVertexBuffer: VertexBuffer;
Expand Down Expand Up @@ -68,7 +69,7 @@ class FillBucket implements Bucket {
this.programConfigurations = new ProgramConfigurationSet(layoutAttributes, options.layers, options.zoom);
this.segments = new SegmentVector();
this.segments2 = new SegmentVector();
this.stateDependentLayerIds = this.layers.filter( (l) => l.isStateDependent()).map((l) => l.id);
this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);

}

Expand Down
3 changes: 2 additions & 1 deletion src/data/bucket/fill_extrusion_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class FillExtrusionBucket implements Bucket {
layers: Array<FillExtrusionStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<FillExtrusionStyleLayer>;
stateDependentLayerIds: Array<string>;

layoutVertexArray: FillExtrusionLayoutArray;
layoutVertexBuffer: VertexBuffer;
Expand All @@ -82,7 +83,7 @@ class FillExtrusionBucket implements Bucket {
this.indexArray = new TriangleIndexArray();
this.programConfigurations = new ProgramConfigurationSet(layoutAttributes, options.layers, options.zoom);
this.segments = new SegmentVector();
this.stateDependentLayerIds = this.layers.filter( (l) => l.isStateDependent()).map((l) => l.id);
this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);

}

Expand Down
3 changes: 2 additions & 1 deletion src/data/bucket/line_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class LineBucket implements Bucket {
layers: Array<LineStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<any>;
stateDependentLayerIds: Array<string>;
features: Array<BucketFeature>;

layoutVertexArray: LineLayoutArray;
Expand Down Expand Up @@ -126,7 +127,7 @@ class LineBucket implements Bucket {
this.programConfigurations = new ProgramConfigurationSet(layoutAttributes, options.layers, options.zoom);
this.segments = new SegmentVector();

this.stateDependentLayerIds = this.layers.filter( (l) => l.isStateDependent()).map((l) => l.id);
this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);
}

populate(features: Array<IndexedFeature>, options: PopulateParameters) {
Expand Down
4 changes: 3 additions & 1 deletion src/data/bucket/symbol_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class SymbolBucket implements Bucket {
layers: Array<SymbolStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<SymbolStyleLayer>;
stateDependentLayerIds: Array<string>;

index: number;
sdfIcons: boolean;
iconsNeedLinear: boolean;
Expand Down Expand Up @@ -300,7 +302,7 @@ class SymbolBucket implements Bucket {
this.sortFeaturesByY = zOrderByViewportY && (layout.get('text-allow-overlap') || layout.get('icon-allow-overlap') ||
layout.get('text-ignore-placement') || layout.get('icon-ignore-placement'));

this.stateDependentLayerIds = this.layers.filter( (l) => l.isStateDependent()).map((l) => l.id);
this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);

this.sourceID = options.sourceID;
}
Expand Down

0 comments on commit 826e5c1

Please sign in to comment.