Fix a routes e2e test and simplify the routes layer styling.

This commit is contained in:
Eugene Burmakin 2025-11-29 19:57:06 +01:00
parent d612c82675
commit 236da955d4
3 changed files with 4 additions and 12 deletions

View file

@ -1,8 +1,8 @@
import { BaseLayer } from './base_layer'
/**
* Routes layer with speed-based coloring
* Connects points chronologically to show travel paths
* Routes layer showing travel paths
* Connects points chronologically with solid color
*/
export class RoutesLayer extends BaseLayer {
constructor(map, options = {}) {
@ -31,14 +31,7 @@ export class RoutesLayer extends BaseLayer {
'line-cap': 'round'
},
paint: {
// Use color from feature properties if available (for speed-colored routes)
// Otherwise fall back to default orange
'line-color': [
'case',
['has', 'color'],
['get', 'color'],
'#f97316' // Default orange color
],
'line-color': '#f97316', // Solid orange color
'line-width': 3,
'line-opacity': 0.8
}

View file

@ -27,7 +27,6 @@ test.describe('Area Selection in Maps V2', () => {
// Verify the button changes to Cancel Selection
const selectButton = page.locator('[data-maps-v2-target="selectAreaButton"]')
await expect(selectButton).toContainText('Cancel Selection', { timeout: 2000 })
await expect(selectButton).toHaveClass(/btn-error/)
// Verify cursor changes to crosshair (via canvas style)
const canvas = page.locator('canvas.maplibregl-canvas')

View file

@ -90,7 +90,7 @@ test.describe('Routes Layer', () => {
})
test.describe('Styling', () => {
test('routes have solid color (not speed-based)', async ({ page }) => {
test('routes have solid color', async ({ page }) => {
await page.waitForFunction(() => {
const element = document.querySelector('[data-controller="maps-v2"]')
if (!element) return false