mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
feat(views/geo): allow displaying scale
This commit is contained in:
@@ -1970,7 +1970,8 @@
|
||||
"max-nesting-depth": "Max nesting depth:",
|
||||
"raster": "Raster",
|
||||
"vector_light": "Vector (Light)",
|
||||
"vector_dark": "Vector (Dark)"
|
||||
"vector_dark": "Vector (Dark)",
|
||||
"show-scale": "Show scale"
|
||||
},
|
||||
"table_context_menu": {
|
||||
"delete_row": "Delete row"
|
||||
|
||||
@@ -138,6 +138,11 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
|
||||
.map(buildMapLayer)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: t("book_properties_config.show-scale"),
|
||||
type: "checkbox",
|
||||
bindToLabel: "map:scale"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -164,6 +164,10 @@ export default class GeoView extends ViewMode<MapData> {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.parentNote.hasLabel("map:scale")) {
|
||||
L.control.scale().addTo(map);
|
||||
}
|
||||
|
||||
this.$container.toggleClass("dark", !!layerData.isDarkTheme);
|
||||
|
||||
layer.addTo(map);
|
||||
@@ -291,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" && attributes.isAffecting(attr, this.parentNote))) {
|
||||
if (loadResults.getAttributeRows().some(attr => ((attr.name === "mapStyle") || (attr.name === "map:scale") && attributes.isAffecting(attr, this.parentNote)))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user