Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions src/modules/leaflet-control-map-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@ L.Control.MapSettings = L.Control.extend({
const alwaysShowExtractsLabelContent = L.DomUtil.create("span", undefined, alwaysShowExtractsLabel);
alwaysShowExtractsLabelContent.textContent = this.options.alwaysShowExtractsLabel;

// always show hazard bounds setting
const alwaysShowHazardBoundsDiv = L.DomUtil.create("div", `${className}-setting-container`, form);

const alwaysShowHazardBoundsLabel = L.DomUtil.create("label", undefined, alwaysShowHazardBoundsDiv);
alwaysShowHazardBoundsLabel.setAttribute("for", "alwaysShowHazardBounds");

const alwaysShowHazardBoundsCheckbox = L.DomUtil.create("input", undefined, alwaysShowHazardBoundsLabel);
alwaysShowHazardBoundsCheckbox.id = "alwaysShowHazardBounds";
alwaysShowHazardBoundsCheckbox.setAttribute("type", "checkbox");
if (this.options.alwaysShowHazardBounds) {
alwaysShowHazardBoundsCheckbox.setAttribute("checked", !!this.options.alwaysShowHazardBounds);
alwaysShowHazardBoundsCheckbox.checked = true;
}
L.DomEvent.on(alwaysShowHazardBoundsCheckbox, "click", this._onSettingChanged, this);

const alwaysShowHazardBoundsLabelContent = L.DomUtil.create("span", undefined, alwaysShowHazardBoundsLabel);
alwaysShowHazardBoundsLabelContent.textContent = this.options.alwaysShowHazardBoundsLabel;

L.DomUtil.create("div", `${className}-separator player-location-help-separator`, form);

// show location labels setting
Expand Down
4 changes: 4 additions & 0 deletions src/pages/map/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ div.leaflet-overlay-pane > svg.leaflet-zoom-animated > g > path.off-level {
fill-opacity: 0.02;
}

.leaflet-container.always-show-hazard-bounds .hazard-outline.not-shown {
display: block;
}

.not-shown {
display: none;
}
Expand Down
15 changes: 14 additions & 1 deletion src/pages/map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ function Map() {
expandSearch: false,
alwaysShowSnipers: true,
alwaysShowExtracts: false,
alwaysShowHazardBounds: false,
hiddenTasks: [],
});

Expand Down Expand Up @@ -541,6 +542,8 @@ function Map() {
alwaysShowSnipersLabel: tMaps("Always show snipers"),
alwaysShowExtracts: !!mapSettingsRef.current.alwaysShowExtracts,
alwaysShowExtractsLabel: tMaps("Always show extracts"),
alwaysShowHazardBounds: mapSettingsRef.current.alwaysShowHazardBounds ?? false,
alwaysShowHazardBoundsLabel: tMaps("Always show hazard outlines"),
collapsed: true,
})
.addTo(map);
Expand Down Expand Up @@ -573,6 +576,13 @@ function Map() {
map._container.classList.remove("always-show-extracts");
}
}
if (e.settingName === "alwaysShowHazardBounds") {
if (e.settingValue) {
map._container.classList.add("always-show-hazard-bounds");
} else {
map._container.classList.remove("always-show-hazard-bounds");
}
}
mapSettingsRef.current[e.settingName] = e.settingValue;
updateSavedMapSettings();
});
Expand All @@ -582,6 +592,9 @@ function Map() {
if (mapSettingsRef.current.alwaysShowExtracts ?? false) {
map._container.classList.add("always-show-extracts");
}
if (mapSettingsRef.current.alwaysShowHazardBounds ?? false) {
map._container.classList.add("always-show-hazard-bounds");
}

map.raidInfoControl = L.control
.raidInfo({
Expand Down Expand Up @@ -1666,7 +1679,7 @@ function Map() {
const rect = L.polygon(outlineToPoly(hazard.outline), {
color: "#ff0000",
weight: 1,
className: "not-shown",
className: "hazard-outline not-shown",
});
const hazardIcon = L.icon({
iconUrl: `${process.env.PUBLIC_URL}/maps/interactive/hazard.png`,
Expand Down
3 changes: 2 additions & 1 deletion src/translations/de/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/en/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/es/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/fr/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/it/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/ja/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/pl/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/pt/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/ru/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"All": "All",
"None": "None",
"Search": "Search",
"Always show extracts": "Always show extracts"
"Always show extracts": "Always show extracts",
"Always show hazard outlines": "Always show hazard outlines"
}
3 changes: 2 additions & 1 deletion src/translations/zh/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
"All": "全部",
"None": "无",
"Search": "搜索",
"Always show extracts": "总是显示撤离点"
"Always show extracts": "总是显示撤离点",
"Always show hazard outlines": "Always show hazard outlines"
}
Loading