forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deferred loading of RTL text plugin detects labels rendered from GeoJ…
…SON sources (mapbox#9091)
- Loading branch information
1 parent
0b92704
commit 1985b67
Showing
7 changed files
with
97 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import SymbolBucket from '../../src/data/bucket/symbol_bucket'; | ||
import SymbolStyleLayer from '../../src/style/style_layer/symbol_style_layer'; | ||
import featureFilter from '../../src/style-spec/feature_filter'; | ||
|
||
export function createSymbolBucket(layerId, font, text, collisionBoxArray) { | ||
const layer = new SymbolStyleLayer({ | ||
id: layerId, | ||
type: 'symbol', | ||
layout: {'text-font': [font], 'text-field': text}, | ||
filter: featureFilter() | ||
}); | ||
layer.recalculate({zoom: 0, zoomHistory: {}}); | ||
|
||
return new SymbolBucket({ | ||
overscaling: 1, | ||
zoom: 0, | ||
collisionBoxArray, | ||
layers: [layer] | ||
}); | ||
} |