Skip to content

Commit 2d00848

Browse files
committed
functional: don't show feature borders for shapes -- resolves ghost line issue.
1 parent 6e8c3cb commit 2d00848

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/layers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class FlatMapStylingLayer
100100
}
101101
})
102102
: []
103+
this.#layerOptions.hasImageLayers = (imageLayers.length > 0)
103104

104105
// Originally only for body layer on AC maps but now also used
105106
// for detail background (FC and AC)
@@ -144,7 +145,6 @@ class FlatMapStylingLayer
144145
const vectorTileSource = this.#map.getSource(VECTOR_TILES_SOURCE)
145146
const haveVectorLayers = !!vectorTileSource
146147

147-
// if no image layers then make feature borders (and lines?) more visible...??
148148
if (haveVectorLayers) {
149149
const featuresVectorSource = this.#vectorSourceId(FEATURES_LAYER)
150150
const vectorFeatures = vectorTileSource.vectorLayerIds!.includes(featuresVectorSource)

src/layers/styling.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface StylingOptions extends StyleLayerOptions
6161
excludeAnnotated?: boolean
6262
colour?: string
6363
dimmed?: boolean
64+
hasImageLayers?: boolean
6465
opacity?: number
6566
showNerveCentrelines?: boolean
6667
}
@@ -424,6 +425,9 @@ export class FeatureBorderLayer extends VectorStyleLayer
424425
}
425426
lineOpacity.push(['boolean', ['feature-state', 'selected'], false], 0.9)
426427
lineOpacity.push(['boolean', ['feature-state', 'annotated'], false], 0.9)
428+
if (options.hasImageLayers) {
429+
lineOpacity.push(['has', 'shape-type'], 0)
430+
}
427431
if (activeRasterLayer) {
428432
lineOpacity.push((outlined && !dimmed) ? 0.3 : 0.1)
429433
} else {

0 commit comments

Comments
 (0)