mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
* fix(map): fit MapLibre routes reliably * fix(map): default planner map to world view * fix(map): only await route geometry when a route is actually pending The fit armed a pending route-refit slot on every fitKey change, even with no route drawn, and only ever cleared it when a route arrived. So a route toggled on much later — after the user had panned elsewhere — was mistaken for the awaited geometry and yanked the camera back, and only on the first toggle. Arm the slot only when a route is already on screen: updateRouteForDay lays down straight lines in the same batch as the fit and upgrades them to real geometry a moment later, so an empty route at fit time means none is coming. * fix(collections): open the empty collection map on the world view A collection with no mappable places centred on Paris, the same hardcoded default this branch removes everywhere else. * feat(map): open the map framed on its places A trip in Japan opened on the world view at 0,0 and only then animated a fitBounds flight across the planet — the hardcoded default was the map's answer to a question its own places already answer. Each renderer now derives its opening camera from the places it receives, at construction: MapView for Leaflet, MapViewGL for MapLibre and Mapbox (whose zoom runs one level below Leaflet's, measuring against a 512px world tile rather than 256px). Doing it at construction is what confines it to load — the map is built once, and by then the trip's places are in hand. Nothing recomputes it afterwards, so the camera stays where the user leaves it, and the opening fit stands down rather than overruling the gentler zoom a lone place opens at. A trip with no coordinates still falls back to the world view. Collections and the public shared-trip page frame themselves the same way. * refactor(settings): drop the default map centre and zoom Nothing reads them now that every map frames itself on its own places, and a home-city default was the wrong answer for the next trip on the other side of the world. The style preview keeps a fixed location of its own: it needs a city to show label density and 3D buildings, which open ocean cannot. * fix(map): frame the map the way each renderer can actually draw Two defects the unit tests missed and running the app exposed. MapLibre and Mapbox opened on Null Island at zoom 2 regardless of the places: the effect that mirrors an external centre prop onto the camera also ran on mount, so it jumped straight to the default nobody passed and threw away the camera the map had just been built with. It now only responds to actual changes, which is what it was for. Leaflet was unaffected — its controller already guarded on the centre changing. A trip spanning Sydney, Reykjavik and Santiago lost Sydney's marker entirely. The narrowest arc containing all three crosses the antimeridian, and framing there is only sound on a renderer that repeats the world: MapLibre and Mapbox draw a marker on whichever copy is nearest the camera, Leaflet draws one world and puts the marker at its absolute position — off-screen. Leaflet now spans the long way round, as L.latLngBounds would. The test that should have caught this wrapped the x-offset in its own projection helper, quietly assuming behaviour Leaflet does not have; it now models each renderer's real wrapping. --------- Co-authored-by: Azalea <noreply@aza.moe>
This commit is contained in:
@@ -45,8 +45,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'نصيحة:',
|
||||
'settings.mapTip':
|
||||
'انقر بزر الماوس الأيمن واسحب لتدوير/إمالة الخريطة. النقر الأوسط لإضافة مكان (النقر الأيمن مخصص للتدوير).',
|
||||
'settings.latitude': 'خط العرض',
|
||||
'settings.longitude': 'خط الطول',
|
||||
'settings.saveMap': 'حفظ الخريطة',
|
||||
'settings.apiKeys': 'مفاتيح API',
|
||||
'settings.mapsKey': 'مفتاح Google Maps API',
|
||||
|
||||
@@ -50,8 +50,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Dica:',
|
||||
'settings.mapTip':
|
||||
'Clique direito e arraste para girar/inclinar o mapa. Clique do meio para adicionar um local (o clique direito é reservado para rotação).',
|
||||
'settings.latitude': 'Latitude',
|
||||
'settings.longitude': 'Longitude',
|
||||
'settings.saveMap': 'Salvar mapa',
|
||||
'settings.apiKeys': 'Chaves de API',
|
||||
'settings.mapsKey': 'Chave da API Google Maps',
|
||||
|
||||
@@ -47,8 +47,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tip:',
|
||||
'settings.mapTip':
|
||||
'Pravé tlačítko myši a táhněte pro rotaci/náklon mapy. Prostřední tlačítko pro přidání místa (pravé tlačítko je vyhrazeno pro rotaci).',
|
||||
'settings.latitude': 'Zeměpisná šířka',
|
||||
'settings.longitude': 'Zeměpisná délka',
|
||||
'settings.saveMap': 'Uložit nastavení mapy',
|
||||
'settings.apiKeys': 'API klíče',
|
||||
'settings.mapsKey': 'Google Maps API klíč',
|
||||
|
||||
@@ -49,8 +49,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tipp:',
|
||||
'settings.mapTip':
|
||||
'Rechtsklick und ziehen, um die Karte zu drehen/neigen. Mittelklick, um einen Ort hinzuzufügen (Rechtsklick ist für die Rotation reserviert).',
|
||||
'settings.latitude': 'Breitengrad',
|
||||
'settings.longitude': 'Längengrad',
|
||||
'settings.saveMap': 'Karte speichern',
|
||||
'settings.apiKeys': 'API-Schlüssel',
|
||||
'settings.mapsKey': 'Google Maps API-Schlüssel',
|
||||
|
||||
@@ -56,8 +56,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tip:',
|
||||
'settings.mapTip':
|
||||
'right-click and drag to rotate/pitch the map. Middle-click to add a place (right-click is reserved for rotation).',
|
||||
'settings.latitude': 'Latitude',
|
||||
'settings.longitude': 'Longitude',
|
||||
'settings.saveMap': 'Save Map',
|
||||
'settings.apiKeys': 'API Keys',
|
||||
'settings.mapsKey': 'Google Maps API Key',
|
||||
|
||||
@@ -50,8 +50,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Consejo:',
|
||||
'settings.mapTip':
|
||||
'Clic derecho y arrastrar para rotar/inclinar el mapa. Clic central para añadir un lugar (el clic derecho está reservado para la rotación).',
|
||||
'settings.latitude': 'Latitud',
|
||||
'settings.longitude': 'Longitud',
|
||||
'settings.saveMap': 'Guardar mapa',
|
||||
'settings.apiKeys': 'Claves API',
|
||||
'settings.mapsKey': 'Clave API de Google Maps',
|
||||
|
||||
@@ -50,8 +50,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Astuce :',
|
||||
'settings.mapTip':
|
||||
'Clic droit et glisser pour pivoter/incliner la carte. Clic milieu pour ajouter un lieu (le clic droit est réservé à la rotation).',
|
||||
'settings.latitude': 'Latitude',
|
||||
'settings.longitude': 'Longitude',
|
||||
'settings.saveMap': 'Enregistrer la carte',
|
||||
'settings.apiKeys': 'Clés API',
|
||||
'settings.mapsKey': 'Clé API Google Maps',
|
||||
|
||||
@@ -52,8 +52,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Συμβουλή:',
|
||||
'settings.mapTip':
|
||||
'κάντε δεξί κλικ και σύρετε για περιστροφή/κλίση του χάρτη. Μεσαίο κλικ για προσθήκη τοποθεσίας (το δεξί κλικ έχει κρατηθεί για περιστροφή).',
|
||||
'settings.latitude': 'Γεωγραφικό Πλάτος',
|
||||
'settings.longitude': 'Γεωγραφικό Μήκος',
|
||||
'settings.saveMap': 'Αποθήκευση Χάρτη',
|
||||
'settings.apiKeys': 'Κλειδιά API',
|
||||
'settings.mapsKey': 'Google Maps API Key',
|
||||
|
||||
@@ -49,8 +49,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tipp:',
|
||||
'settings.mapTip':
|
||||
'Jobb klikk és húzás a térkép forgatásához/döntéséhez. Középső kattintás hely hozzáadásához (a jobb klikk a forgatáshoz van fenntartva).',
|
||||
'settings.latitude': 'Szélességi fok',
|
||||
'settings.longitude': 'Hosszúsági fok',
|
||||
'settings.saveMap': 'Térkép mentése',
|
||||
'settings.apiKeys': 'API kulcsok',
|
||||
'settings.mapsKey': 'Google Maps API kulcs',
|
||||
|
||||
@@ -48,8 +48,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tip:',
|
||||
'settings.mapTip':
|
||||
'Klik kanan dan seret untuk memutar/memiringkan peta. Klik tengah untuk menambah tempat (klik kanan untuk rotasi).',
|
||||
'settings.latitude': 'Lintang',
|
||||
'settings.longitude': 'Bujur',
|
||||
'settings.saveMap': 'Simpan Peta',
|
||||
'settings.apiKeys': 'API Keys',
|
||||
'settings.mapsKey': 'Google Maps API Key',
|
||||
|
||||
@@ -50,8 +50,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Suggerimento:',
|
||||
'settings.mapTip':
|
||||
'Click destro e trascina per ruotare/inclinare la mappa. Click centrale per aggiungere un luogo (il click destro è riservato alla rotazione).',
|
||||
'settings.latitude': 'Latitudine',
|
||||
'settings.longitude': 'Longitudine',
|
||||
'settings.saveMap': 'Salva Mappa',
|
||||
'settings.apiKeys': 'Chiavi API',
|
||||
'settings.mapsKey': 'Chiave API Google Maps',
|
||||
|
||||
@@ -47,8 +47,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapHighQualityWarning': '低性能デバイスではパフォーマンスに影響する場合があります。',
|
||||
'settings.mapTipLabel': 'ヒント:',
|
||||
'settings.mapTip': '右クリック+ドラッグで回転/傾き。中クリックで場所を追加(右クリックは回転用)。',
|
||||
'settings.latitude': '緯度',
|
||||
'settings.longitude': '経度',
|
||||
'settings.saveMap': '地図を保存',
|
||||
'settings.apiKeys': 'APIキー',
|
||||
'settings.mapsKey': 'Google Maps APIキー',
|
||||
|
||||
@@ -47,8 +47,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': '팁:',
|
||||
'settings.mapTip':
|
||||
'우클릭 후 드래그하여 지도를 회전/기울이세요. 가운데 클릭으로 장소를 추가할 수 있습니다 (우클릭은 회전 전용).',
|
||||
'settings.latitude': '위도',
|
||||
'settings.longitude': '경도',
|
||||
'settings.saveMap': '지도 저장',
|
||||
'settings.apiKeys': 'API 키',
|
||||
'settings.mapsKey': 'Google Maps API 키',
|
||||
|
||||
@@ -49,8 +49,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tip:',
|
||||
'settings.mapTip':
|
||||
'Rechts-klik en sleep om de kaart te roteren/kantelen. Middenklik om een locatie toe te voegen (rechts-klik is voor rotatie).',
|
||||
'settings.latitude': 'Breedtegraad',
|
||||
'settings.longitude': 'Lengtegraad',
|
||||
'settings.saveMap': 'Kaart opslaan',
|
||||
'settings.apiKeys': 'API-sleutels',
|
||||
'settings.mapsKey': 'Google Maps API-sleutel',
|
||||
|
||||
@@ -48,8 +48,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Wskazówka:',
|
||||
'settings.mapTip':
|
||||
'Kliknij prawym przyciskiem i przeciągnij, aby obrócić/pochylić mapę. Środkowy przycisk dodaje miejsce (prawy jest zarezerwowany dla obrotu).',
|
||||
'settings.latitude': 'Szerokość',
|
||||
'settings.longitude': 'Długość',
|
||||
'settings.saveMap': 'Zapisz mapę',
|
||||
'settings.apiKeys': 'Klucze API',
|
||||
'settings.mapsKey': 'Klucz Google Maps API',
|
||||
|
||||
@@ -47,8 +47,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Совет:',
|
||||
'settings.mapTip':
|
||||
'Зажмите правую кнопку мыши и перетащите, чтобы повернуть/наклонить карту. Клик средней кнопкой — добавить место (правая кнопка зарезервирована для вращения).',
|
||||
'settings.latitude': 'Широта',
|
||||
'settings.longitude': 'Долгота',
|
||||
'settings.saveMap': 'Сохранить карту',
|
||||
'settings.apiKeys': 'API-ключи',
|
||||
'settings.mapsKey': 'API-ключ Google Maps',
|
||||
|
||||
@@ -49,8 +49,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Tips:',
|
||||
'settings.mapTip':
|
||||
'högerklicka och dra för att rotera eller luta kartan. Mittklicka för att lägga till en plats (högerklick är reserverat för rotation).',
|
||||
'settings.latitude': 'Latitud',
|
||||
'settings.longitude': 'Longitud',
|
||||
'settings.saveMap': 'Spara karta',
|
||||
'settings.apiKeys': 'API nycklar',
|
||||
'settings.mapsKey': 'Google Maps API nyckel',
|
||||
|
||||
@@ -48,8 +48,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'İpucu:',
|
||||
'settings.mapTip':
|
||||
'Haritayı döndürmek/eğmek için sağ tıklayıp sürükleyin. Yer eklemek için orta tıklama (sağ tık döndürmeye ayrılmıştır).',
|
||||
'settings.latitude': 'Enlem',
|
||||
'settings.longitude': 'Boylam',
|
||||
'settings.saveMap': 'Haritayı Kaydet',
|
||||
'settings.apiKeys': 'API Anahtarları',
|
||||
'settings.mapsKey': 'Google Maps API Anahtarı',
|
||||
|
||||
@@ -49,8 +49,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Порада:',
|
||||
'settings.mapTip':
|
||||
'Затисніть праву кнопку миші та перетягніть, щоб повернути/нахилити карту. Клік середньою кнопкою — додати місце (права кнопка зарезервована для обертання).',
|
||||
'settings.latitude': 'Широта',
|
||||
'settings.longitude': 'Довгота',
|
||||
'settings.saveMap': 'Зберегти карту',
|
||||
'settings.apiKeys': 'API-ключі',
|
||||
'settings.mapsKey': 'API-ключ Google Maps',
|
||||
|
||||
@@ -50,8 +50,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapTipLabel': 'Mẹo:',
|
||||
'settings.mapTip':
|
||||
'nhấp chuột phải và kéo để xoay/cao độ bản đồ. Nhấp chuột giữa để thêm địa điểm (nhấp chuột phải được dành riêng cho việc xoay).',
|
||||
'settings.latitude': 'Vĩ độ',
|
||||
'settings.longitude': 'Kinh độ',
|
||||
'settings.saveMap': 'Lưu bản đồ',
|
||||
'settings.apiKeys': 'API Key',
|
||||
'settings.mapsKey': 'Google Maps API Key',
|
||||
|
||||
@@ -46,8 +46,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapHighQualityWarning': '可能影響低階裝置的效能。',
|
||||
'settings.mapTipLabel': '提示:',
|
||||
'settings.mapTip': '右鍵點擊並拖曳以旋轉/傾斜地圖。中鍵點擊新增地點(右鍵用於旋轉)。',
|
||||
'settings.latitude': '緯度',
|
||||
'settings.longitude': '經度',
|
||||
'settings.saveMap': '儲存地圖',
|
||||
'settings.apiKeys': 'API 金鑰',
|
||||
'settings.mapsKey': 'Google Maps API 金鑰',
|
||||
|
||||
@@ -46,8 +46,6 @@ const settings: TranslationStrings = {
|
||||
'settings.mapHighQualityWarning': '可能影响低端设备的性能。',
|
||||
'settings.mapTipLabel': '提示:',
|
||||
'settings.mapTip': '右键点击并拖动以旋转/倾斜地图。中键点击添加地点(右键用于旋转)。',
|
||||
'settings.latitude': '纬度',
|
||||
'settings.longitude': '经度',
|
||||
'settings.saveMap': '保存地图',
|
||||
'settings.apiKeys': 'API 密钥',
|
||||
'settings.mapsKey': 'Google Maps API 密钥',
|
||||
|
||||
Reference in New Issue
Block a user