refactor(views/geo): use a different attribute

This commit is contained in:
Elian Doran 2025-07-24 22:18:30 +03:00
parent aeb356bf54
commit 4f99db0c90
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
{ {
label: t("book_properties_config.map-style"), label: t("book_properties_config.map-style"),
type: "combobox", type: "combobox",
bindToLabel: "mapStyle", bindToLabel: "map:style",
defaultValue: DEFAULT_MAP_LAYER_NAME, defaultValue: DEFAULT_MAP_LAYER_NAME,
options: [ options: [
{ {

View File

@ -146,7 +146,7 @@ export default class GeoView extends ViewMode<MapData> {
worldCopyJump: true worldCopyJump: true
}); });
const layerName = this.parentNote.getLabelValue("mapStyle") ?? DEFAULT_MAP_LAYER_NAME; const layerName = this.parentNote.getLabelValue("map:style") ?? DEFAULT_MAP_LAYER_NAME;
let layer: Layer; let layer: Layer;
const layerData = MAP_LAYERS[layerName]; const layerData = MAP_LAYERS[layerName];
@ -295,7 +295,7 @@ export default class GeoView extends ViewMode<MapData> {
} }
// Full reload if map layer is changed. // Full reload if map layer is changed.
if (loadResults.getAttributeRows().some(attr => ((attr.name === "mapStyle") || (attr.name === "map:scale") && attributes.isAffecting(attr, this.parentNote)))) { if (loadResults.getAttributeRows().some(attr => (attr.name?.startsWith("map:") && attributes.isAffecting(attr, this.parentNote)))) {
return true; return true;
} }
} }