Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Improvements including Cloud Tiling #42

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

indig0fox
Copy link
Member

No description provided.

@indig0fox indig0fox self-assigned this Apr 14, 2022
@indig0fox
Copy link
Member Author

  • adds leaflet control to show/hide of units/vehicles, side markers, global markers, and projectile markers
  • adds leaflet control to select displayed terrain layer, if map has more than just topo rendered
    • supports "Topographic", "Topographic Dark", "Topographic Relief", "Color Relief"
  • changes popups over entities to a 'glow white' effect surrounding black text, for easy of seeing units in very close proximity as well as on dark backgrounds
  • adds compatibility for LOGIC side objects, which are typically excluded but in some cases have been re-initialized as live entities due to module actions (add editable objects)
  • adds "GeneralEvent" class for support with new addon functionality to add generic messaging in event timeline
  • minor EN localization improvement on time menu display
  • sets up ocap.ui.js setting for useCloudTiles -- will fetch data from a centralized map server and load tiles from there, eliminating the need for server admins to install individual maps

@indig0fox indig0fox marked this pull request as ready for review April 14, 2022 16:02
@Fank Fank self-requested a review April 22, 2022 13:40
<div id="frameSliderContainer">
<div id="eventTimeline"></div>
<div class="frameSliderContainer2">
<input type="range" id="frameSlider" min="0" value="0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In html a / at the end of an element is not needed, its only part of the xhtml specification

static/scripts/localizable.js Outdated Show resolved Hide resolved
@@ -186,12 +186,12 @@ let _localizable = {
},
"time_mission": {
"ru": "Время миссии",
"en": "Mission Time Elapsed",
"en": "In-Game World Time",
"de": "Verstrichene Missionszeit"
Copy link
Member

@Fank Fank Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"de": "Verstrichene Missionszeit"
"de": "In-Game Zeit"

static/scripts/localizable.js Outdated Show resolved Hide resolved
}
// getElement() {
// return this._element;
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove it when not neede anymore

indig0fox and others added 2 commits May 5, 2022 10:38
Co-authored-by: Florian Kinder <florian.kinder@fankserver.com>
Co-authored-by: Florian Kinder <florian.kinder@fankserver.com>
@indig0fox
Copy link
Member Author

Need assistance in checking local files for installed maps before then loading from remote tileserver.

Currently this uses ui.useCloudTiles defined in /static/scripts/ocap.ui.js as a hard switch. Instead, check server and if not installed fall back to centralized repository to check.

This is for map.json

web/static/scripts/ocap.js

Lines 178 to 194 in a10d227

let mapJsonUrl;
if (ui.useCloudTiles) {
mapJsonUrl = `https://maps.ocap2.com/${worldName}/map.json`;
} else {
mapJsonUrl = 'images/maps/' + worldName + '/map.json';
}
// $.getJSON(mapJsonUrl, function (data) {
// console.log(data);
// console.log(data.responseJSON);
// });
map = $.ajax({
type: "GET",
url: mapJsonUrl,
async: false
}).responseJSON;
return Object.assign(defaultMap, map);

This is for the actual layers

web/static/scripts/ocap.js

Lines 386 to 403 in a10d227

switch (ui.useCloudTiles) {
case true: {
topoLayerUrl = ('https://maps.ocap2.com/' + worldName.toLowerCase() + '/{z}/{x}/{y}.png');
topoDarkLayerUrl = ('https://maps.ocap2.com/' + worldName.toLowerCase() + '/topoDark/{z}/{x}/{y}.png');
topoReliefLayerUrl = ('https://maps.ocap2.com/' + worldName.toLowerCase() + '/topoRelief/{z}/{x}/{y}.png');
colorReliefLayerUrl = ('https://maps.ocap2.com/' + worldName.toLowerCase() + '/colorRelief/{z}/{x}/{y}.png');
contourLayerUrl = ('https://maps.ocap2.com/' + worldName.toLowerCase() + '/contours.geojson');
break;
}
case false: {
topoLayerUrl = ('images/maps/' + worldName + '/{z}/{x}/{y}.png');
topoDarkLayerUrl = ('images/maps/' + worldName + '/topoDark/{z}/{x}/{y}.png');
topoReliefLayerUrl = ('images/maps/' + worldName + '/topoRelief/{z}/{x}/{y}.png');
colorReliefLayerUrl = ('images/maps/' + worldName + '/colorRelief/{z}/{x}/{y}.png');
contourLayerUrl = ('images/maps/' + worldName + '/contours.geojson');
break;
}
}

@indig0fox indig0fox linked an issue May 24, 2023 that may be closed by this pull request
…rcede 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
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.

Player disconnect counts as death
4 participants