fix: draw street map ground and repair mobile layout
- Turn the satellite ground off behind SATELLITE_GROUND so OSM streets, parks and land use are drawn; the imagery index is no longer fetched. - Restore phone rules lost in the CSS-to-JS theme migration (#rank height, toolbar button size) and replace invalid -var() values. - Add a landscape-phone layout and make the briefing scrollable. - Add two-finger pinch zoom to the big map. - Add regression tests for the theme and the skipped imagery request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { apiClient } from './apiClient.js';
|
||||
import { SATELLITE_GROUND } from '../constants/world.js';
|
||||
const WORLD_FILES = {
|
||||
buildings: './data/buildings.bin',
|
||||
imagery: './imagery/index.json',
|
||||
@@ -6,7 +7,7 @@ const WORLD_FILES = {
|
||||
|
||||
/** Loads optional world assets without preventing the OSM fallback on network failure.
|
||||
* @param {AbortSignal} signal - Cancels startup when the game unmounts.
|
||||
* @returns {Promise<Array>} Binary buildings and imagery index, or null fallbacks.
|
||||
* @returns {Promise<Array>} Binary buildings and imagery index (null while SATELLITE_GROUND is off), or null fallbacks.
|
||||
*/
|
||||
export async function loadWorldFiles(signal) {
|
||||
const requests = [
|
||||
@@ -14,9 +15,12 @@ export async function loadWorldFiles(signal) {
|
||||
responseType: 'arraybuffer',
|
||||
signal,
|
||||
}),
|
||||
apiClient.get(WORLD_FILES.imagery, {
|
||||
signal,
|
||||
}),
|
||||
// Without the satellite ground the tile index is not needed, so it is not downloaded.
|
||||
SATELLITE_GROUND
|
||||
? apiClient.get(WORLD_FILES.imagery, {
|
||||
signal,
|
||||
})
|
||||
: Promise.resolve({ data: null }),
|
||||
];
|
||||
const results = await Promise.allSettled(requests);
|
||||
return results.map((result) => (result.status === 'fulfilled' ? result.value.data : null));
|
||||
|
||||
Reference in New Issue
Block a user