Skip to content

feat: merge web improvements from PR #42 (cloud tiling, layer controls)#87

Merged
fank merged 39 commits intomainfrom
feature/leaflet-improvements
Jan 30, 2026
Merged

feat: merge web improvements from PR #42 (cloud tiling, layer controls)#87
fank merged 39 commits intomainfrom
feature/leaflet-improvements

Conversation

@fank
Copy link
Member

@fank fank commented Jan 30, 2026

Summary

This PR merges the long-standing PR #42 by @indig0fox with the current main branch. The original PR was created in April 2022 and contained many valuable improvements that have been pending merge.

Features Added

  • Cloud Tile Fallback: Uses maps.ocap2.com when local map tiles are unavailable
  • Layer Controls: Switch between terrain styles (Topo/TopoDark/TopoRelief/ColorRelief) via Leaflet basemaps control
  • Zoom Info Control: New Leaflet control showing zoom level info
  • Version Info Display: Shows extension and addon versions in the info dialog
  • Map Bounds Fitting: Automatically fits map to marker bounds after operation loads
  • Localization Improvements: Better English/German translations for time display labels

Technical Changes

  • Added jQuery 3.1.1 dependency
  • Added new Leaflet controls (L.Control.Basemaps, L.Control.Zoominfo)
  • Updated Leaflet to 1.7.1
  • Updated .gitignore patterns for data/maps directories
  • Added setting.json.example template

Conflict Resolution

Resolved 7 file conflicts with main branch:

  • Preserved chunked streaming support from main (protobuf/flatbuffers decoders)
  • Preserved download button from main
  • Preserved additional language options (Czech, Italian) from main
  • Merged localization keys from PR (version info strings)
  • Kept URLSearchParams approach for URL argument parsing

External Dependencies Verified

URL Status
https://maps.ocap2.com/ Working
https://code.jquery.com/jquery-3.1.1.min.js Working

Original PR Reference

Closes #42

Test plan

  • Build passes (go build ./cmd/ocap-webserver)
  • Unit tests pass (go test ./...)
  • Load a mission and verify playback works
  • Verify cloud tile fallback works for maps not installed locally
  • Test layer switching controls
  • Check version info displays in info dialog

indig0fox and others added 30 commits October 5, 2021 16:20
- adds leaflet control
- allows satellite layer to be loaded if available and switched between topo and sat
- allows show/hide of units/vehicles, side markers, global markers, and projectile markers

- fixes setCrew bug
* only use cloud tiles as fallback when enabled

* debug log

* show cloud map data parsing error

* fix `world._useCloudTiles` condition check
- account for new "displayName" attribute in worlds' map.json to supercede the previous "name" attribute
- reduce max zoom by 1 level
- fix console logging for incomplete hit/killed events
- change to calculating initial view bounds by initial marker positions if BIS_fnc_moduleCoverMap not present
- add better logging in general, including in debug stream
- if world isn't rendered in cloud or local, show alert & load placeholder map so playback can still be viewed
- don't cache map.json to support future installation/render and stop it from requiring a full browser cache clear
- cleanup old geojson code
- move Leaflet controls to bottom right and integrate with Leaflet DOM
- removes a couple css overrides for the above
- update ui title bar to also include the played date and map name
- linting
- fix error where popup is not initialized yet but tries to update
- reposition website logo to bottom left
- ensure it follows left panel visibility
- fix loading the shareURL using proper URLSearchParams
- parse date from opRecord, or if from share URL, from filename if possible. if backup file that was manually restored and failed initial upload, show "<UnknownDate>"
- created setting.json.example, but left setting.json so as not to break Docker build on accident
indig0fox and others added 9 commits June 6, 2023 16:17
Merges indig0fox's feature branch with the following improvements:

- Add cloud tile fallback (maps.ocap2.com) when local map tiles unavailable
- Add Leaflet layer controls for switching between terrain styles
  (Topo/TopoDark/TopoRelief/ColorRelief)
- Add Leaflet zoom info control
- Add jQuery dependency for improved DOM handling
- Add version info display (extension and addon versions)
- Improve localization with better English/German translations
- Add map bounds fitting after operation loads
- Various code style improvements

New files:
- static/leaflet/L.Control.Basemaps.js/css
- static/leaflet/L.Control.Zoominfo.js/css
- setting.json.example

This merge resolves conflicts between the original PR (created Apr 2022)
and the current main branch which includes chunked streaming support.

Co-authored-by: IndigoFox <[email protected]>
The PR's Leaflet 1.7.1 uses ES module syntax which breaks
when loaded as a regular script tag. The plugins (rotatedMarker,
svgIcon, pattern, etc.) depend on the global L variable being
defined synchronously.
The streaming mode path (processOpStreaming) was not setting
the global worldObject variable, causing getMapImageBounds()
to fail with 'Cannot read properties of null'.
- Change all http://maps.ocap2.com to https://maps.ocap2.com to avoid
  mixed content warnings when served over HTTPS
- Fix maps/.gitkeep which contained RTF markup instead of being empty
The data/ and maps/ directories are already in .gitignore,
so .gitkeep files cannot be tracked anyway. The application
or deployment should create these directories as needed.
The patterns /data/*.json.gz, /data/*.json, and /maps/*/ are
already covered by data/ and maps/ respectively.
- Add setting.json to .gitignore (contains secrets)
- Update setting.json.example with all available options:
  - prefixURL, db, markers, ammo, maps, data, static paths
  - conversion settings (enabled, interval, batchSize, chunkSize, storageEngine)
- Change example secret to 'change-me' to make it clear it must be changed
Re-enable L.StripePattern support for marker brush types:
- Horizontal, Vertical, Grid, FDiagonal, BDiagonal, DiagGrid, Cross

The pattern is created in the constructor when brush options are set,
and added to the map when the marker is rendered. The pattern library
handles duplicate additions gracefully via L.stamp tracking.

Removes commented-out dead code that was marked as 'broken'.
@fank fank merged commit 6f2afb8 into main Jan 30, 2026
4 checks passed
@fank fank deleted the feature/leaflet-improvements branch January 30, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments