diff --git a/CHANGELOG.md b/CHANGELOG.md index 309ec73c..6f9d8e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ 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. diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js index 12092891..1efff1e7 100644 --- a/app/javascript/controllers/maps_controller.js +++ b/app/javascript/controllers/maps_controller.js @@ -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), diff --git a/app/models/point.rb b/app/models/point.rb index 7be8524a..838e59ff 100644 --- a/app/models/point.rb +++ b/app/models/point.rb @@ -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, [