Skip to content

[Bug] Applying an offset to a geojson layer with PathStyleExtension breaks antialiasing #9395

Description

@colindm

Description

An example of a geojson layer I created where antialiasing normally works:

new GeoJsonLayer({
id: 'lines',
data: linesDisplayGeojson,
getLineColor: getLineColor,
getLineWidth: SUBWAY_TUNNEL_WIDTH * LINE_WIDTH_MODIFIER,
lineWidthMinPixels: MIN_TRACK_PIXEL_WIDTH * LINE_WIDTH_MODIFIER,
lineCapRounded: true,
beforeId: 'buildings-3d',
updateTriggers: {
getLineColor: [hasActiveJourney]
},
}),

But when I update it to:

new GeoJsonLayer({
id: 'lines',
data: linesDisplayGeojson,
getLineColor: getLineColor,
getLineWidth: SUBWAY_TUNNEL_WIDTH * LINE_WIDTH_MODIFIER,
lineWidthMinPixels: MIN_TRACK_PIXEL_WIDTH * LINE_WIDTH_MODIFIER,
lineCapRounded: true,
beforeId: 'buildings-3d',
updateTriggers: {
getLineColor: [hasActiveJourney]
},
getOffset: (f: any) => f.properties.offset,
extensions: [new PathStyleExtension({ offset: true })],
}),

Antialiasing breaks. If I take the code that works and just add

extensions: [new PathStyleExtension()]

It works fine it's just when I pass in the {offset: true} flag that things break.

An image of a line I drew without the offset flag

Image

VS one with it

Image

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

No response

Steps to Reproduce

Here's an example of a line I generated:

test.json

Environment

  • Framework version:
    "@deck.gl/core": "^9.0.38",
    "@deck.gl/geo-layers": "^9.0.38",
    "@deck.gl/layers": "^9.0.38",
    "@deck.gl/mapbox": "^9.0.38",
    "@deck.gl/react": "^9.0.38",
    "maplibre-gl": "^4.7.0",
    "react-map-gl": "^7.1.7"
  • Browser: Chrome
  • OS: MacOS 15.1.1 (24B91)

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions