mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Merge pull request #1566 from Freika/fix/live-map-checkbox
Fix live map checkbox
This commit is contained in:
commit
b94be44cbf
4 changed files with 27 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
## Fixed
|
||||
|
||||
- The Warden error in jobs is now fixed. #1556
|
||||
- The Live Map setting is now respected.
|
||||
- The Live Map info modal is now displayed. #665
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -969,6 +969,12 @@ export default class extends BaseController {
|
|||
this.routeOpacity = parseFloat(newSettings.route_opacity) || 0.6;
|
||||
this.clearFogRadius = parseInt(newSettings.fog_of_war_meters) || 50;
|
||||
|
||||
// Update the DOM data attribute to keep it in sync
|
||||
const mapElement = document.getElementById('map');
|
||||
if (mapElement) {
|
||||
mapElement.setAttribute('data-user_settings', JSON.stringify(this.userSettings));
|
||||
}
|
||||
|
||||
// Store current layer states
|
||||
const layerStates = {
|
||||
Points: this.map.hasLayer(this.markersLayer),
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ class Point < ApplicationRecord
|
|||
|
||||
# rubocop:disable Metrics/MethodLength Metrics/AbcSize
|
||||
def broadcast_coordinates
|
||||
return unless user.safe_settings.live_map_enabled
|
||||
|
||||
PointsChannel.broadcast_to(
|
||||
user,
|
||||
[
|
||||
|
|
|
|||
|
|
@ -156,6 +156,23 @@
|
|||
<label class="modal-backdrop" for="speed_colored_routes_info">Close</label>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" id="live_map_enabled_info" class="modal-toggle" />
|
||||
<div class="modal focus:z-99" role="dialog">
|
||||
<div class="modal-box">
|
||||
<h3 class="text-lg font-bold">Live map</h3>
|
||||
<p class="py-4">
|
||||
This checkbox will enable the live map.
|
||||
</p>
|
||||
<p class="py-4">
|
||||
Uncheck this checkbox if you want to disable the live map.
|
||||
</p>
|
||||
<p class="py-4">
|
||||
When the live map is enabled, the map will update in real-time with the latest points.
|
||||
</p>
|
||||
</div>
|
||||
<label class="modal-backdrop" for="live_map_enabled_info">Close</label>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" id="speed_color_scale_info" class="modal-toggle" />
|
||||
<div class="modal focus:z-99" role="dialog">
|
||||
<div class="modal-box">
|
||||
|
|
|
|||
Loading…
Reference in a new issue