mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-10-09 11:12:48 +00:00
refactor: fix map controlls
This commit is contained in:
@@ -28,10 +28,10 @@ export class CompassControlComponent {
|
||||
),
|
||||
),
|
||||
),
|
||||
map(_event => {
|
||||
// const pitch = event.target.transform.pitch;
|
||||
// const bearing = event.target.transform.bearing;
|
||||
// return `rotateX(${pitch}deg) rotateZ(${bearing}deg)`;
|
||||
map(event => {
|
||||
const pitch = event.target._camera.getPitch();
|
||||
const bearing = event.target._camera.getBearing();
|
||||
return `rotateX(${pitch}deg) rotateZ(${bearing}deg)`;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ class CustomGeolocateControl extends GeolocateControl {
|
||||
this._container = document.createElement('div');
|
||||
this._map = map;
|
||||
this._setupUI();
|
||||
this._finishSetupUI('geolocation' in navigator);
|
||||
this._container = container;
|
||||
return this._container;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
<ion-content id="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"
|
||||
[fitBounds]="(bounds | async) ?? undefined"
|
||||
[fitBoundsOptions]="{maxZoom: 15, padding: {top: 100, bottom: 50, left: 50, right: 50}, animate: false}"
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
-->
|
||||
<mgl-map
|
||||
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"
|
||||
[attributionControl]="false"
|
||||
[center]="$any(place.geo.point.coordinates)"
|
||||
|
||||
Reference in New Issue
Block a user