Fix initial camera on marker
All checks were successful
Deploy Spot / deploy (push) Successful in 34s

This commit is contained in:
2026-06-01 09:51:25 +02:00
parent 36f9057a30
commit 6cad199431
3 changed files with 20 additions and 15 deletions

View File

@@ -469,17 +469,18 @@ export default {
)) || null;
}
if(oHashMarker) { //Direct link to marker
//Direct link to marker
if(oHashMarker) {
oBounds.extend(new LngLat(oHashMarker.longitude, oHashMarker.latitude));
}
else if( //Blog Mode: Fit to last message
this.project.mode == this.consts.modes.blog &&
this.markers.length > 0
) {
let oLastMsg = this.markers.at(-1);
oBounds.extend(new LngLat(oLastMsg.longitude, oLastMsg.latitude));
//Blog Mode: Fit to last marker
else if(this.project.mode == this.consts.modes.blog && this.markers.length > 0) {
let oLastMarker = this.markers.at(-1);
if(oLastMarker) oBounds.extend(new LngLat(oLastMarker.longitude, oLastMarker.latitude));
}
else { //Pre/Histo Mode: Fit to track
//Pre Mode, Histo Mode, Blog Mode without markers or missing direct link marker: Fit to track
if(oBounds.isEmpty()) {
for(const iFeatureId in this.track.features) {
oBounds = this.track.features[iFeatureId].geometry.coordinates.reduce(
(bounds, coord) => bounds.extend(coord),