feat: fix gps map projection and update map config
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { type CameraState } from '../camera/camera'
|
||||
import { type TileStoreStats } from '../tile/tileStore'
|
||||
import { type LonLatPoint } from '../../utils/projection'
|
||||
import { type LonLatPoint, type MapCalibration } from '../../utils/projection'
|
||||
import { type TileZoomBounds } from '../../utils/remoteMapConfig'
|
||||
|
||||
export interface MapScene {
|
||||
tileSource: string
|
||||
osmTileSource: string
|
||||
zoom: number
|
||||
centerTileX: number
|
||||
centerTileY: number
|
||||
exactCenterWorldX: number
|
||||
exactCenterWorldY: number
|
||||
tileBoundsByZoom: Record<number, TileZoomBounds> | null
|
||||
viewportWidth: number
|
||||
viewportHeight: number
|
||||
@@ -21,6 +24,10 @@ export interface MapScene {
|
||||
previewOriginY: number
|
||||
track: LonLatPoint[]
|
||||
gpsPoint: LonLatPoint
|
||||
gpsCalibration: MapCalibration
|
||||
gpsCalibrationOrigin: LonLatPoint
|
||||
osmReferenceEnabled: boolean
|
||||
overlayOpacity: number
|
||||
}
|
||||
|
||||
export type MapRendererStats = TileStoreStats
|
||||
@@ -34,8 +41,8 @@ export interface MapRenderer {
|
||||
|
||||
export function buildCamera(scene: MapScene): CameraState {
|
||||
return {
|
||||
centerWorldX: scene.centerTileX,
|
||||
centerWorldY: scene.centerTileY,
|
||||
centerWorldX: scene.centerTileX + 0.5,
|
||||
centerWorldY: scene.centerTileY + 0.5,
|
||||
viewportWidth: scene.viewportWidth,
|
||||
viewportHeight: scene.viewportHeight,
|
||||
visibleColumns: scene.visibleColumns,
|
||||
@@ -44,5 +51,3 @@ export function buildCamera(scene: MapScene): CameraState {
|
||||
rotationRad: scene.rotationRad,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user