feat(field): Symbole am Stück setzen + eigene GPS-Position (v1.5.4)
- Tap-to-place bleibt scharf: mehrere gleiche Symbole nacheinander setzen (z.B. 4 Hydranten), Hinweis zeigt Anzahl + "Fertig"-Knopf - Zeichen-Werkzeug wählen beendet den Platzier-Modus - GPS: eigene Position dauerhaft mit Genauigkeitskreis + Blickrichtung - Beim Öffnen bleibt die Karte auf dem Einsatzort (springt nicht mehr auf die eigene Position, wenn ein Einsatzort gesetzt ist) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -706,16 +706,34 @@ export function MapView({
|
||||
map.current.addControl(new maplibregl.NavigationControl(), 'bottom-right')
|
||||
map.current.addControl(new maplibregl.ScaleControl(), 'bottom-left')
|
||||
|
||||
// Geolocation: center map on user's position
|
||||
// Geolocation: eigene Position dauerhaft anzeigen (Punkt + Genauigkeit + Blickrichtung)
|
||||
const geolocate = new maplibregl.GeolocateControl({
|
||||
positionOptions: { enableHighAccuracy: true },
|
||||
trackUserLocation: true,
|
||||
showAccuracyCircle: false,
|
||||
})
|
||||
showAccuracyCircle: true,
|
||||
// showUserHeading zeigt die Blickrichtung — in den Typen dieser Version (noch)
|
||||
// nicht deklariert, zur Laufzeit aber vorhanden.
|
||||
showUserHeading: true,
|
||||
} as any)
|
||||
map.current.addControl(geolocate, 'bottom-right')
|
||||
|
||||
// Auto-trigger geolocation when map loads to center on user's real position
|
||||
map.current.on('load', () => { geolocate.trigger() })
|
||||
// Position beim Laden aktivieren (Punkt erscheint), aber bei gesetztem Einsatzort
|
||||
// auf dem Einsatzort bleiben statt auf die eigene Position zu springen.
|
||||
const einsatzortCenter = project?.mapCenter
|
||||
const hasEinsatzort = !!einsatzortCenter &&
|
||||
!(einsatzortCenter.lng === 8.5417 && einsatzortCenter.lat === 47.3769)
|
||||
map.current.on('load', () => {
|
||||
geolocate.trigger()
|
||||
if (hasEinsatzort && einsatzortCenter) {
|
||||
geolocate.once('geolocate', () => {
|
||||
map.current?.easeTo({
|
||||
center: [einsatzortCenter.lng, einsatzortCenter.lat],
|
||||
zoom: project?.mapZoom || 17,
|
||||
duration: 600,
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
map.current.on('load', () => {
|
||||
const m = map.current
|
||||
|
||||
Reference in New Issue
Block a user