Skip to content

Commit a21815e

Browse files
authored
Merge pull request #58 from akhuoa/bugfix/setPaint
Fix coloured and outlined options in setPaint
2 parents 7f9e4f4 + 8173f6e commit a21815e

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/flatmap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,8 +1182,8 @@ export class FlatMap
11821182
//==================
11831183
{
11841184
options = utils.setDefaults(options, {
1185-
colour: true,
1186-
outline: true
1185+
coloured: true,
1186+
outlined: true
11871187
})
11881188
if (this.#userInteractions !== null) {
11891189
this.#userInteractions.setPaint(options)

src/interactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class UserInteractions
200200
this.#map = flatmap.map!
201201

202202
// Default colour settings
203-
this.#colourOptions = {colour: true, outline: true}
203+
this.#colourOptions = {coloured: true, outlined: true}
204204

205205
// Track enabled features
206206

src/layers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class FlatMapStylingLayer
368368
#setPaintRasterLayers(options)
369369
//============================
370370
{
371-
const coloured = !('colour' in options) || options.colour
371+
const coloured = !('coloured' in options) || options.coloured
372372
for (const layer of this.#rasterStyleLayers) {
373373
// Check active status when resetting to visible....
374374
this.#map.setLayoutProperty(layer.id, 'visibility',

src/layers/styling.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export class FeatureFillLayer extends VectorStyleLayer
330330

331331
paintStyle(options: StylingOptions, changes=false)
332332
{
333-
const coloured = options.coloured || true
333+
const coloured = !('coloured' in options) || options.coloured
334334
const dimmed = options.dimmed || false
335335
const functional = (options.flatmapStyle === FLATMAP_STYLE.FUNCTIONAL)
336336
const paintStyle: PaintSpecification = {
@@ -397,8 +397,8 @@ export class FeatureBorderLayer extends VectorStyleLayer
397397

398398
paintStyle(options: StylingOptions, changes=false)
399399
{
400-
const coloured = options.coloured || true
401-
const outlined = options.outlined || true
400+
const coloured = !('coloured' in options) || options.coloured
401+
const outlined = !('outlined' in options) || options.outlined
402402
const dimmed = options.dimmed || false
403403
const activeRasterLayer = options.activeRasterLayer || false
404404
const functional = (options.flatmapStyle === FLATMAP_STYLE.FUNCTIONAL)
@@ -490,7 +490,7 @@ export class FeatureLineLayer extends VectorStyleLayer
490490

491491
paintStyle(options: StylingOptions, changes=false)
492492
{
493-
const coloured = options.coloured || true
493+
const coloured = !('coloured' in options) || options.coloured
494494
const paintStyle: PaintSpecification = {
495495
'line-color': [
496496
'case',
@@ -1323,7 +1323,7 @@ export class RasterStyleLayer extends StyleLayer
13231323

13241324
style(layer: FlatMapLayer, options: StylingOptions): RasterLayerSpecification
13251325
{
1326-
const coloured = options.coloured || true
1326+
const coloured = !('coloured' in options) || options.coloured
13271327
const style: RasterLayerSpecification = {
13281328
...super.style(layer),
13291329
source: this.id,

0 commit comments

Comments
 (0)