refactor: fix map controlls

This commit is contained in:
Rainer Killinger
2026-10-01 18:10:57 +02:00
parent 32cc443600
commit dfb7336f25
4 changed files with 11 additions and 6 deletions
@@ -28,10 +28,10 @@ export class CompassControlComponent {
), ),
), ),
), ),
map(_event => { map(event => {
// const pitch = event.target.transform.pitch; const pitch = event.target._camera.getPitch();
// const bearing = event.target.transform.bearing; const bearing = event.target._camera.getBearing();
// return `rotateX(${pitch}deg) rotateZ(${bearing}deg)`; return `rotateX(${pitch}deg) rotateZ(${bearing}deg)`;
}), }),
); );
} }
@@ -40,6 +40,7 @@ class CustomGeolocateControl extends GeolocateControl {
this._container = document.createElement('div'); this._container = document.createElement('div');
this._map = map; this._map = map;
this._setupUI(); this._setupUI();
this._finishSetupUI('geolocation' in navigator);
this._container = container; this._container = container;
return this._container; return this._container;
} }
@@ -21,7 +21,9 @@
<ion-content id="map"> <ion-content id="map">
<mgl-map <mgl-map
[mapStyle]="('(prefers-color-scheme: dark)' | mediaQuery | async) ? 'dark' : ('light' | mapStyleUrl)" [mapStyle]="
('(prefers-color-scheme: dark)' | mediaQuery | async) ? ('dark' | mapStyleUrl) : ('light' | mapStyleUrl)
"
[attributionControl]="false" [attributionControl]="false"
[fitBounds]="(bounds | async) ?? undefined" [fitBounds]="(bounds | async) ?? undefined"
[fitBoundsOptions]="{maxZoom: 15, padding: {top: 100, bottom: 50, left: 50, right: 50}, animate: false}" [fitBoundsOptions]="{maxZoom: 15, padding: {top: 100, bottom: 50, left: 50, right: 50}, animate: false}"
@@ -14,7 +14,9 @@
--> -->
<mgl-map <mgl-map
auto-3d auto-3d
[mapStyle]="('(prefers-color-scheme: dark)' | mediaQuery | async) ? 'dark' : ('light' | mapStyleUrl)" [mapStyle]="
('(prefers-color-scheme: dark)' | mediaQuery | async) ? ('dark' | mapStyleUrl) : ('light' | mapStyleUrl)
"
[interactive]="false" [interactive]="false"
[attributionControl]="false" [attributionControl]="false"
[center]="$any(place.geo.point.coordinates)" [center]="$any(place.geo.point.coordinates)"