Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 7 tasks
colindm opened this issue Feb 3, 2025 · 0 comments · May be fixed by #9408
Open
2 of 7 tasks

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

colindm opened this issue Feb 3, 2025 · 0 comments · May be fixed by #9408
Labels

Comments

@colindm
Copy link

colindm commented Feb 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant