v1.0.3: Fix PDF footer overlap, arrow alignment, screenshot quality, arrowheads in export

This commit is contained in:
Pepe Ziberi
2026-02-21 16:28:32 +01:00
parent c11565aaf8
commit 25d3d553ff
5 changed files with 38 additions and 12 deletions

View File

@@ -1377,12 +1377,12 @@ export function MapView({
const lineCoords = f.geometry.coordinates as number[][]
if (lineCoords.length < 2) return
// Get last two points to calculate arrow direction
// Get last two points to calculate arrow direction using screen-projected coords
const p1 = lineCoords[lineCoords.length - 2]
const p2 = lineCoords[lineCoords.length - 1]
const angle = Math.atan2(p2[1] - p1[1], p2[0] - p1[0]) * (180 / Math.PI)
// MapLibre uses screen coords where Y is inverted, so negate the angle
const screenAngle = -angle + 90
const px1 = map.current.project(p1 as [number, number])
const px2 = map.current.project(p2 as [number, number])
const screenAngle = Math.atan2(px2.y - px1.y, px2.x - px1.x) * (180 / Math.PI) + 90
const color = (f.properties.color as string) || '#000000'
const arrowEl = document.createElement('div')