Lots of styling tweaks, add filter links between layers
This commit is contained in:
parent
5cefc4d25f
commit
c15f3d2036
28 changed files with 263 additions and 217 deletions
|
@ -237,7 +237,7 @@ export interface LayerConfigJson {
|
|||
/**
|
||||
* All the extra questions for filtering
|
||||
*/
|
||||
filter?: (FilterConfigJson) [],
|
||||
filter?: (FilterConfigJson) [] | {sameAs: string},
|
||||
|
||||
/**
|
||||
* This block defines under what circumstances the delete dialog is shown for objects of this layer.
|
||||
|
|
|
@ -232,7 +232,7 @@ export interface LayoutConfigJson {
|
|||
|
||||
/**
|
||||
* If set to true, the basemap will not scroll outside of the area visible on initial zoom.
|
||||
* If set to [[lat0, lon0], [lat1, lon1]], the map will not scroll outside of those bounds.
|
||||
* If set to [[lon, lat], [lon, lat]], the map will not scroll outside of those bounds.
|
||||
* Off by default, which will enable panning to the entire world
|
||||
*/
|
||||
lockLocation?: boolean | [[number, number], [number, number]] | number[][];
|
||||
|
|
|
@ -24,6 +24,7 @@ import Link from "../../UI/Base/Link";
|
|||
import {Utils} from "../../Utils";
|
||||
import {TagsFilter} from "../../Logic/Tags/TagsFilter";
|
||||
import Table from "../../UI/Base/Table";
|
||||
import FilterConfigJson from "./Json/FilterConfigJson";
|
||||
|
||||
export default class LayerConfig extends WithContextLoader {
|
||||
|
||||
|
@ -58,7 +59,8 @@ export default class LayerConfig extends WithContextLoader {
|
|||
|
||||
public readonly tagRenderings: TagRenderingConfig[];
|
||||
public readonly filters: FilterConfig[];
|
||||
|
||||
public readonly filterIsSameAs: string;
|
||||
|
||||
constructor(
|
||||
json: LayerConfigJson,
|
||||
context?: string,
|
||||
|
@ -243,9 +245,14 @@ export default class LayerConfig extends WithContextLoader {
|
|||
|
||||
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map((tr, i) => new TagRenderingConfig(<TagRenderingConfigJson>tr, this.id + ".tagRenderings[" + i + "]"))
|
||||
|
||||
this.filters = (json.filter ?? []).map((option, i) => {
|
||||
return new FilterConfig(option, `${context}.filter-[${i}]`)
|
||||
});
|
||||
if(json.filter !== undefined && json.filter !== null && json.filter["sameAs"] !== undefined){
|
||||
this.filterIsSameAs = json.filter["sameAs"]
|
||||
this.filters = []
|
||||
}else{
|
||||
this.filters = (<FilterConfigJson[]>json.filter ?? []).map((option, i) => {
|
||||
return new FilterConfig(option, `${context}.filter-[${i}]`)
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const duplicateIds = Utils.Dupiclates(this.filters.map(f => f.id))
|
||||
|
@ -302,8 +309,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
return undefined
|
||||
}
|
||||
const baseTags = TagUtils.changeAsProperties(this.source.osmTags.asChange({id: "node/-1"}))
|
||||
return mapRendering.GenerateLeafletStyle(new UIEventSource(baseTags), false,
|
||||
{noSize: true, includeBadges: false}).html
|
||||
return mapRendering.GetSimpleIcon(new UIEventSource(baseTags))
|
||||
}
|
||||
|
||||
public GenerateDocumentation(usedInThemes: string[], layerIsNeededBy: Map<string, string[]>, dependencies: {
|
||||
|
|
|
@ -66,7 +66,7 @@ export default class LayoutConfig {
|
|||
this.maintainer = json.maintainer;
|
||||
this.credits = json.credits;
|
||||
this.version = json.version;
|
||||
this.language = Array.from(Object.keys(json.title));
|
||||
this.language = json.mustHaveLanguage ?? Array.from(Object.keys(json.title));
|
||||
|
||||
{
|
||||
if (typeof json.title === "string") {
|
||||
|
|
|
@ -150,8 +150,8 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
tags: UIEventSource<any>,
|
||||
clickable: boolean,
|
||||
options?: {
|
||||
noSize: false | boolean,
|
||||
includeBadges: true | boolean
|
||||
noSize?: false | boolean,
|
||||
includeBadges?: true | boolean
|
||||
}
|
||||
):
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue