Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3de757b
number of improvements
indig0fox Oct 5, 2021
b349edd
visual improvements, cloud tiling
indig0fox Oct 9, 2021
0092ceb
enough for now
indig0fox Oct 11, 2021
31f0ed4
more
indig0fox Jan 3, 2022
e993e99
adds generalEvent for custom event announcements in timeline
indig0fox Mar 28, 2022
7fd1d89
fix markers
indig0fox Mar 28, 2022
1ee3b30
fix for sideLogic units
indig0fox Mar 30, 2022
ae09630
small ui changes
indig0fox Mar 30, 2022
e80afaa
changes to new topo modes
indig0fox Apr 8, 2022
0c15566
fixes cloud tiling CORS issues
indig0fox Apr 13, 2022
4f540e7
Merge remote-tracking branch 'origin/main' into ind/leaflet-functiona…
indig0fox Apr 14, 2022
2e7dbd2
now uses https map.json fetch
indig0fox Apr 14, 2022
9897139
crisper entity popup text
indig0fox Apr 14, 2022
e8d662a
hide AI names by default, more work needed
indig0fox Apr 15, 2022
b3cce90
hotfix leaflet.pattern failure
indig0fox Apr 19, 2022
a10d227
minor index cleanup
indig0fox Apr 21, 2022
77d3092
Update static/scripts/localizable.js
indig0fox May 5, 2022
ae41485
Update static/scripts/localizable.js
indig0fox May 5, 2022
35528a4
use cloud tiles as fallback (#44)
a-sync May 7, 2022
4195095
fix vehicle crew display, dont carry d/c deaths to rejoined players
indig0fox Sep 27, 2022
2e0c70c
ignore data and maps files in git
indig0fox Oct 6, 2022
d844668
ensure that groups in left pane are ordered alphabetically
indig0fox Oct 12, 2022
072b1b4
update missing tiles URL
indig0fox Oct 15, 2022
f4f3659
Merge remote-tracking branch 'origin/main' into ind/leaflet-functiona…
indig0fox Oct 18, 2022
15f5b6d
update data and maps ignores
indig0fox Nov 4, 2022
09697e4
fix basemaps control file reference
indig0fox Nov 4, 2022
c397022
addon and extension version in info screen
JessevGool Feb 3, 2023
b913af2
Merge branch 'web-ui' into ind/leaflet-functionality
indig0fox May 24, 2023
5d40851
indig0fox May 26, 2023
8767500
fix loading share URL, fix websiteLogo position
indig0fox May 27, 2023
70e64e6
fix fetch exception for loading without a rendered map
indig0fox Jun 6, 2023
18a9a57
Merge PR #42: Web improvements including cloud tiling
fank Jan 30, 2026
123ccc3
fix: revert Leaflet to 1.6.0 for plugin compatibility
fank Jan 30, 2026
646c43f
fix: set worldObject global in streaming mode
fank Jan 30, 2026
09fc3fc
fix: use HTTPS for cloud tile URLs and fix corrupted .gitkeep
fank Jan 30, 2026
32ab515
chore: remove unnecessary .gitkeep files
fank Jan 30, 2026
01988d2
chore: remove redundant .gitignore patterns
fank Jan 30, 2026
96d820e
chore: gitignore setting.json, expand setting.json.example
fank Jan 30, 2026
37e305f
feat: implement leaflet.pattern support for marker brushes
fank Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# IDE
.idea
.vscode

# Build artifacts
/ocap-webserver
Expand All @@ -9,6 +10,7 @@
data.db
data/
maps/
setting.json
static/data
static/images/maps

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,19 @@ docker run --name ocap-web -d \
This Project is based on [Golang](https://golang.org/dl/)

### Windows

```bash
go build -o ocap-webserver.exe ./cmd
```

### Linux

```bash
go build -o ocap-webserver ./cmd
```

### Docker

```bash
docker build -t ocap-webserver .
```
11 changes: 0 additions & 11 deletions setting.json

This file was deleted.

25 changes: 25 additions & 0 deletions setting.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"listen": "127.0.0.1:5000",
"prefixURL": "",
"secret": "change-me",
"db": "data.db",
"markers": "assets/markers",
"ammo": "assets/ammo",
"maps": "maps",
"data": "data",
"static": "static",
"logger": false,
"customize": {
"websiteURL": "",
"websiteLogo": "",
"websiteLogoSize": "32px",
"disableKillCount": false
},
"conversion": {
"enabled": false,
"interval": "5m",
"batchSize": 1,
"chunkSize": 300,
"storageEngine": "protobuf"
}
}
5 changes: 5 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
<link rel="stylesheet" href="style/common.css" />
<link rel="stylesheet" href="style/index.css" />
<link rel="icon" type="img/png" href="images/favicon.png" />
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="leaflet/leaflet-src.js"></script>
<script src="leaflet/leaflet.rotatedMarker.js"></script>
<script src="leaflet/leaflet.svgIcon.js"></script>
<script src="leaflet/leaflet.pattern.js"></script>
<script src="leaflet/L.Icon.Pulse.js"></script>
<link rel="stylesheet" href="leaflet/L.Icon.Pulse.css" />
<link rel="stylesheet" href="leaflet/L.Control.Zoominfo.css" />
<script src="leaflet/L.Control.Zoominfo.js"></script>
<link rel="stylesheet" href="leaflet/L.Control.Basemaps.css" />
<script src="leaflet/L.Control.Basemaps.js"></script>
<script src="scripts/ocap.marker.js"></script>
<script src="scripts/ocap.entity.js"></script>
<script src="scripts/ocap.event.js"></script>
Expand Down
28 changes: 28 additions & 0 deletions static/leaflet/L.Control.Basemaps.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.basemaps {
padding: 4px;
}
.basemaps.closed .basemap {
display: none;
}
.basemaps.closed .basemap.alt {
display: inline-block;
}
.basemaps.closed .basemap.alt h4 {
display: none;
}

.basemap {
display: inline-block; /* todo: flexbox? */
cursor: pointer;
}
.basemap.active img {
border-color: orange;
box-shadow: 2px 2px 4px #000;
}
.basemap img {
width: 64px;
border: 2px solid #FFF;
margin: 0 2px;
border-radius: 40px;
box-shadow: 0 1px 5px rgba(0,0,0,0.65)
}
1 change: 1 addition & 0 deletions static/leaflet/L.Control.Basemaps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions static/leaflet/L.Control.Zoominfo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/** Slider **/
.leaflet-control-zoominfo-wrap {
padding-top: 5px;
padding-bottom: 5px;
background-color: #fff;
border-bottom: 1px solid #ccc;
}
.leaflet-control-zoominfo-body {
width: 2px;
border: solid #fff;
border-width: 0px 9px 0px 9px;
background-color: black;
margin: 0 auto;
}

.leaflet-control-zoominfo-body:hover {
cursor: pointer;
}

.leaflet-dragging .leaflet-control-zoominfo,
.leaflet-dragging .leaflet-control-zoominfo-wrap,
.leaflet-dragging .leaflet-control-zoominfo-body,
.leaflet-dragging .leaflet-control-zoominfo a,
.leaflet-dragging .leaflet-control-zoominfo a.leaflet-control-zoominfo-disabled {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}

/** Leaflet Zoom Styles **/
.leaflet-container .leaflet-control-zoominfo {
margin-left: 10px;
margin-top: 10px;
}
.leaflet-control-zoominfo a {
width: 26px;
height: 26px;
text-align: center;
text-decoration: none;
color: black;
display: block;
}
.leaflet-control-zoominfo a:hover {
background-color: #f4f4f4;
}
.leaflet-control-zoominfo-in {
font: bold 18px 'Lucida Console', Monaco, monospace;
}
.leaflet-control-zoominfo-in:after{
content:"+"
}
.leaflet-control-zoominfo-out {
font: bold 22px 'Lucida Console', Monaco, monospace;
}
.leaflet-control-zoominfo-out:after{
content:"−"
}
.leaflet-control-zoominfo a.leaflet-control-zoominfo-disabled {
cursor: default;
color: #bbb;
}

/* Touch */
.leaflet-touch .leaflet-control-zoominfo-body {
background-position: 10px 0px;
}
.leaflet-touch .leaflet-control-zoominfo a {
width: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-control-zoominfo a:hover {
width: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-control-zoominfo-in {
font-size: 24px;
line-height: 29px;
}
.leaflet-touch .leaflet-control-zoominfo-out {
font-size: 28px;
line-height: 30px;
}
.leaflet-touch .leaflet-control-zoominfo {
box-shadow: none;
border: 4px solid rgba(0,0,0,0.3);
}

.leaflet-control-zoominfo-info {
margin-left: -13px;
background-color: #fff;
border: none;
width: 22px;
height: 22px;
display: block;
text-align: center;
text-decoration: none;
color: black;
padding: 4px 4px 0px 3px;

border-radius: 4px;
cursor: default;
}

.leaflet-control-zoominfoinfo h4 {
margin: 0 0 0px 0px;
color: #000;
}

/* Old IE */

.leaflet-oldie .leaflet-control-zoominfo-wrap {
width: 26px;
}

.leaflet-oldie .leaflet-control-zoominfo {
border: 1px solid #999;
}

.leaflet-oldie .leaflet-control-zoominfo-in {
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '+');
}
.leaflet-oldie .leaflet-control-zoominfo-out {
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '-');
}
138 changes: 138 additions & 0 deletions static/leaflet/L.Control.Zoominfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
(function (factory) {
// Packaging/modules magic dance
var L;
if (typeof define === 'function' && define.amd) {
// AMD
define(['leaflet'], factory);
} else if (typeof module !== 'undefined') {
// Node/CommonJS
L = require('leaflet');
module.exports = factory(L);
} else {
// Browser globals
if (typeof window.L === 'undefined') {
throw new Error('Leaflet must be loaded first');
}
factory(window.L);
}
}(function (L) {
'use strict';

L.Control.Zoominfo = (function () {

var Zoominfo = L.Control.extend({
options: {
position: 'topleft',
styleNS: 'leaflet-control-zoominfo'
},

onAdd: function (map) {
this._map = map;
this._ui = this._createUI();

map.whenReady(this._initInfo, this)
.whenReady(this._initEvents, this)
.whenReady(this._updateInfoValue, this)
.whenReady(this._updateDisabled, this);
return this._ui.bar;
},

onRemove: function (map) {
map.off('zoomlevelschange', this._updateSize, this)
.off('zoomend zoomlevelschange', this._updateInfoValue, this)
.off('zoomend zoomlevelschange', this._updateDisabled, this);
},

_createUI: function () {
var ui = {},
ns = this.options.styleNS;

ui.bar = L.DomUtil.create('div', ns + ' leaflet-bar');
ui.zoomIn = this._createZoomBtn('in', 'top', ui.bar);
ui.wrap = L.DomUtil.create('div', ns + '-wrap leaflet-bar-part', ui.bar);
ui.zoomOut = this._createZoomBtn('out', 'bottom', ui.bar);
ui.body = L.DomUtil.create('div', ns + '-body', ui.wrap);
ui.info = L.DomUtil.create('div', ns + '-info');

L.DomEvent.disableClickPropagation(ui.bar);
L.DomEvent.disableClickPropagation(ui.info);

return ui;
},
_createZoomBtn: function (zoomDir, end, container) {
var classDef = this.options.styleNS + '-' + zoomDir +
' leaflet-bar-part' +
' leaflet-bar-part-' + end,
link = L.DomUtil.create('a', classDef, container);

link.href = '#';
link.title = 'Zoom ' + zoomDir;

L.DomEvent.on(link, 'click', L.DomEvent.preventDefault);

return link;
},

_initInfo: function () {
this._ui.body.appendChild(this._ui.info);
},
_initEvents: function () {
this._map
.on('zoomend zoomlevelschange', this._updateInfoValue, this)
.on('zoomend zoomlevelschange', this._updateDisabled, this);

L.DomEvent.on(this._ui.zoomIn, 'click', this._zoomIn, this);
L.DomEvent.on(this._ui.zoomOut, 'click', this._zoomOut, this);
},

_zoomIn: function (e) {
this._map.zoomIn(e.shiftKey ? 3 : 1);
},
_zoomOut: function (e) {
this._map.zoomOut(e.shiftKey ? 3 : 1);
},

_zoomLevels: function () {
var zoomLevels = this._map.getMaxZoom() - this._map.getMinZoom() + 1;
return zoomLevels < Infinity ? zoomLevels : 0;
},
_toZoomLevel: function (value) {
return value + this._map.getMinZoom();
},
_toValue: function (zoomLevel) {
return zoomLevel - this._map.getMinZoom();
},

_updateInfoValue: function () {
this._ui.info.innerHTML = '<strong>'+ this._map.getZoom() + '</strong>';
},
_updateDisabled: function () {
var zoomLevel = this._map.getZoom(),
className = this.options.styleNS + '-disabled';

L.DomUtil.removeClass(this._ui.zoomIn, className);
L.DomUtil.removeClass(this._ui.zoomOut, className);

if (zoomLevel === this._map.getMinZoom()) {
L.DomUtil.addClass(this._ui.zoomOut, className);
}
if (zoomLevel === this._map.getMaxZoom()) {
L.DomUtil.addClass(this._ui.zoomIn, className);
}
}
});

return Zoominfo;
})();

L.Map.addInitHook(function () {
if (this.options.zoominfoControl) {
this.zoominfoControl = new L.Control.Zoominfo();
this.addControl(this.zoominfoControl);
}
});

L.control.zoominfo = function (options) {
return new L.Control.Zoominfo(options);
};
}));
Loading
Loading