Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(views/geo): use a different attribute
Elian Doran4f99db0c9044
diff --git a/apps/client/src/widgets/ribbon_widgets/book_properties_config.ts b/apps/client/src/widgets/ribbon_widgets/book_properties_config.tsindex 3b76246d51..09acb6e992 100644--- a/apps/client/src/widgets/ribbon_widgets/book_properties_config.ts+++ b/apps/client/src/widgets/ribbon_widgets/book_properties_config.ts@@ -116,7 +116,7 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {{label: t("book_properties_config.map-style"),type: "combobox",- bindToLabel: "mapStyle",+ bindToLabel: "map:style",defaultValue: DEFAULT_MAP_LAYER_NAME,options: [{diff --git a/apps/client/src/widgets/view_widgets/geo_view/index.ts b/apps/client/src/widgets/view_widgets/geo_view/index.tsindex 170b67b20e..2810fa5bc4 100644--- a/apps/client/src/widgets/view_widgets/geo_view/index.ts+++ b/apps/client/src/widgets/view_widgets/geo_view/index.ts@@ -146,7 +146,7 @@ export default class GeoView extends ViewMode<MapData> {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;const layerData = MAP_LAYERS[layerName];@@ -295,7 +295,7 @@ export default class GeoView extends ViewMode<MapData> {}// 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;}}