mirror of
https://github.com/ceratic/project_vollidioten_website.git
synced 2026-05-14 00:16:47 +02:00
- Added world map page with interactive marker display - Implemented admin map management for marker CRUD operations - Added map layers and markers seed data to database - Integrated new routes for map functionality - Updated database configuration for production environment - Added documentation page route - Enhanced package.json with required dependencies for map features
57 lines
2.0 KiB
JavaScript
57 lines
2.0 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
import MapProcessor from './backend/map-processor.js';
|
|
|
|
async function testMapAssembly() {
|
|
console.log('🧪 Testing World Map Assembly...');
|
|
|
|
try {
|
|
const mapProcessor = new MapProcessor();
|
|
await mapProcessor.init();
|
|
|
|
console.log('✅ Map processor initialized');
|
|
|
|
// Test getting map tiles
|
|
const tiles = await mapProcessor.getMapTiles();
|
|
console.log(`✅ Found ${tiles.length} map tiles`);
|
|
|
|
if (tiles.length > 0) {
|
|
console.log('📋 Sample tiles:');
|
|
tiles.slice(0, 5).forEach(tile => {
|
|
console.log(` - ${tile.filename}: X=${tile.x}, Z=${tile.z}`);
|
|
});
|
|
|
|
// Test calculating dimensions
|
|
const dimensions = await mapProcessor.calculateMapDimensions(tiles);
|
|
console.log(`✅ Map dimensions: ${dimensions.width}x${dimensions.height}px`);
|
|
console.log(`✅ Offset: X=${dimensions.offsetX}, Z=${dimensions.offsetZ}`);
|
|
|
|
// Test assembling world map
|
|
console.log('🔄 Assembling world map...');
|
|
const success = await mapProcessor.assembleWorldMap();
|
|
|
|
if (success) {
|
|
console.log('✅ World map assembled successfully!');
|
|
|
|
// Test getting metadata
|
|
const metadata = await mapProcessor.getMapMetadata();
|
|
console.log('✅ Map metadata:', metadata);
|
|
|
|
// Test coordinate conversion
|
|
const coords = await mapProcessor.getCoordinateConversion(-2560, 512);
|
|
console.log('✅ Coordinate conversion test:', coords);
|
|
|
|
} else {
|
|
console.log('❌ Failed to assemble world map');
|
|
}
|
|
} else {
|
|
console.log('❌ No map tiles found. Please ensure map files are in backend/uploads/map/');
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Test failed:', error);
|
|
}
|
|
}
|
|
|
|
testMapAssembly();
|