feat: topo-dark style variant + fix font glyph loading#145
Conversation
Add dark-themed topo style with muted colors (#1B1B1B background, dark sea/contours/roads, light-on-dark labels) and stronger hillshade. Refactor topo style to use dedicated layer styles and render order instead of reusing color-relief's buildVectorFeatureLayers. Fix MapLibre font glyph 404s by using transformRequest to rewrite glyph URLs to the correct server path, avoiding fragile relative URL resolution from the style JSON document location.
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new "topo-dark" map style variant, providing users with an alternative dark-themed topographic map. Alongside this new feature, the existing topographic style's layer management has been improved for clarity and maintainability. Crucially, it also addresses a client-side issue where MapLibre font glyphs were failing to load due to incorrect URL resolution, enhancing the robustness of map rendering across all styles. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new topo-dark map style variant, refactors the existing topo style generation for better separation and maintainability, and fixes an issue with font glyph loading in MapLibre. The changes are well-structured and address the goals outlined in the description. I've provided a couple of suggestions to reduce code duplication in the new style generation logic, which would further improve the code's maintainability.
… styles Extract buildOrderedVectorLayers() and layerStyleToMap() shared by both topo variants. Replace duplicated symbol layer definitions (bush, rock, tree, fuelstation, transmitter, stack) with makeTopoSymbol() helper.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Summary
#1B1B1B), muted colors (sea#1a3a5c, contours#5a4a3a/#3a5a7a, roads#888888, forest#3a5a2a), light-on-dark labels with#111111halos, and stronger hillshade (0.5 exaggeration, 0.6 shadow)knownTopoLayerStylesmap andtopoLayerOrderrender order instead of reusing color-relief'sbuildVectorFeatureLayersGET /fonts/OpenSans-Regular/0-255.pbf 404) by addingtransformRequestto rewrite glyph URLs to the correctimages/maps/fonts/server path — avoids fragile relative URL resolution from the style JSON locationChanges
internal/maptool/styles.go—StyleTopoDarkconstant,knownTopoDarkLayerStylesmap,buildTopoDarkLayers/buildTopoDarkVectorFeatureLayers, topo style refactor withknownTopoLayerStyles/topoLayerOrder/buildTopoVectorFeatureLayersinternal/maptool/metadata.go— generatetopo-dark.jsonstyle fileinternal/maptool/styles_test.go— addStyleTopoDarkto variant test loopstatic/scripts/ocap.js— add Topo Dark style candidate, addtransformRequestfor font glyph URL rewritingTest plan
go build ./...go test ./internal/maptool/