68d5058106f10e8711d91099d2c852233d90c81e
Deploy & Release / build-and-deploy (push) Successful in 1m3s
Derail Valley Community Map with Catenary DC Layer
Interactive vector web map of Derail Valley railway network with DC electrification infrastructure overlay (Catenary-DC / WE6SIM mod).
Architecture & Stack
- Frontend: Vanilla ES6 modules, HTML5 Canvas 2D (double-buffered with dynamic overlay).
- Coordinate System: Game engine coordinates (meters), origin at bottom-left, mapped via
MatrixandViewtransforms. - Datasets:
catenary_dv.json: 164 chained polylines (optimized from 3,751 segments), 9 traction substations, 5 neutral sections, 34 interruption clusters, 129 warning signs.trackdata_dv.json: Rail tracks (cubic Bézier curves) and junction points.poi_dv.json: Stations, offices, service tracks, turntables, landmarks.shop_items.json: Shop inventories and prices.
Catenary Layer Features
- Wire Suspension Rendering:
Single(6.0m, 1500V/750V): standard solid vector line.Dual(6.0m, 1500V): high-capacity twin catenary stroke.Quad(6.0m, 1500V): heavy 4-wire mountain pass stroke with dark border.Trolley(6.0m, 750V): fine yard wire.Side Rail(4.5m, 1000V): dashed 3rd contact rail at IME and SM mine tracks.Neutral Sections(0V): contrasting red-and-white dashed lines with0Vdanger badges.
- Color Modes:
Voltage: 1500V DC (#00d2ff), 1000V DC (#ff9f1c), 750V DC (#2ec4b6), 0V Neutral (#e63946).Substation: Distinct color per feeding substation (CME/IME1500, CP750, FF1500, HB1500, IME1000, IMW1500, OR750, SM1500, SM1000).Wire Type: Color-coded by physical suspension category.
- Markers & Tooltips:
- Traction Substations:
⚡badge with nominal voltage, supply voltage, max load (kW), and regenerative inverter presence. - Neutral Sections:
⛔badge with section ID, length, connecting substations, and disconnect traction warning. - Interruption Signs:
⤓diamond badge for pantograph drop/raise warnings. - Contact Wires: Nearest-point hovering displaying voltage, substation feed, category, and segment length.
- Traction Substations:
CommunityMapLocation Mod Integration
Bug Fixes
- Rotation Desync:
LocationResponseacceptsrotationTransformfrom locomotive transform or camera heading (fixing player orientation desync). - URL Formatting: Fixed string immutability bug in
address.replaceAllinsideconnectPlayerLocation.
CORS Configuration
In <GameDirectory>/Mods/CommunityMapLocation/Settings.xml:
<Settings>
<Port>9090</Port>
<RequestSourceType>Any</RequestSourceType>
<RequestSource>http://localhost:8080</RequestSource>
</Settings>
Note: If RequestSourceType is Any, the game mod allows cross-origin requests from any web host (localhost, GitHub Pages, Gitea).
CI/CD Workflows
- Gitea Actions (
.gitea/workflows/deploy.yaml): JSON dataset validation, JS syntax verification, artifact packaging withactions/upload-artifact@v3, releases withakkuman/gitea-release-action@v1. - GitHub Pages (
.github/workflows/deploy-pages.yml): Automated GitHub Pages deployment on push tomain.
Languages
JavaScript
78.3%
C#
13.5%
HTML
4.3%
CSS
3.9%