Merge master
This commit is contained in:
commit
7ebb3d721c
411 changed files with 21814 additions and 8717 deletions
|
@ -111,7 +111,7 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
|
|||
},
|
||||
calculatedTags: [
|
||||
"_first_comment=get(feat)('comments')[0].text.toLowerCase()",
|
||||
"_trigger_index=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.osm.be/\\([a-zA-Z_-]+\\)\\(.html\\)?.*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()",
|
||||
"_trigger_index=(() => {const lines = feat.properties['_first_comment'].split('\\n'); const matchesMapCompleteURL = lines.map(l => l.match(\".*https://mapcomplete.\\(org|osm.be\\)/\\([a-zA-Z_-]+\\)\\(.html\\)?.*#import\")); const matchedIndexes = matchesMapCompleteURL.map((doesMatch, i) => [doesMatch !== null, i]).filter(v => v[0]).map(v => v[1]); return matchedIndexes[0] })()",
|
||||
"_comments_count=get(feat)('comments').length",
|
||||
"_intro=(() => {const lines = get(feat)('comments')[0].text.split('\\n'); lines.splice(get(feat)('_trigger_index')-1, lines.length); return lines.filter(l => l !== '').join('<br/>');})()",
|
||||
"_tags=(() => {let lines = get(feat)('comments')[0].text.split('\\n').map(l => l.trim()); lines.splice(0, get(feat)('_trigger_index') + 1); lines = lines.filter(l => l != ''); return lines.join(';');})()",
|
||||
|
|
|
@ -3,6 +3,7 @@ import { ExtraFuncParams, ExtraFunctions } from "../../Logic/ExtraFunctions"
|
|||
import LayerConfig from "./LayerConfig"
|
||||
import { SpecialVisualization } from "../../UI/SpecialVisualization"
|
||||
import SpecialVisualizations from "../../UI/SpecialVisualizations"
|
||||
import { Exception } from "sass"
|
||||
|
||||
export default class DependencyCalculator {
|
||||
public static GetTagRenderingDependencies(tr: TagRenderingConfig): string[] {
|
||||
|
@ -39,6 +40,10 @@ export default class DependencyCalculator {
|
|||
|
||||
for (let i = 0; layer.presets !== undefined && i < layer.presets.length; i++) {
|
||||
const preset = layer.presets[i]
|
||||
const snapTo = preset.preciseInput?.snapToLayers
|
||||
if (snapTo && !Array.isArray(snapTo)) {
|
||||
throw new Error("snapToLayers is not an array; it is " + snapTo)
|
||||
}
|
||||
preset.preciseInput?.snapToLayers?.forEach((id) => {
|
||||
deps.push({
|
||||
neededLayer: id,
|
||||
|
|
|
@ -228,7 +228,7 @@ export interface LayoutConfigJson {
|
|||
*
|
||||
* Note that {lat},{lon},{zoom}, {language} and {theme} will be replaced
|
||||
*
|
||||
* Default: {icon: "./assets/svg/pop-out.svg", href: 'https://mapcomplete.osm.be/{theme}.html?lat={lat}&lon={lon}&z={zoom}, requirements: ["iframe","no-welcome-message]},
|
||||
* Default: {icon: "./assets/svg/pop-out.svg", href: 'https://mapcomplete.org/{theme}.html?lat={lat}&lon={lon}&z={zoom}, requirements: ["iframe","no-welcome-message]},
|
||||
*
|
||||
*/
|
||||
extraLink?: ExtraLinkConfigJson
|
||||
|
|
|
@ -491,7 +491,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
new Title("Themes using this layer", 4),
|
||||
new List(
|
||||
(usedInThemes ?? []).map(
|
||||
(id) => new Link(id, "https://mapcomplete.osm.be/" + id)
|
||||
(id) => new Link(id, "https://mapcomplete.org/" + id)
|
||||
)
|
||||
),
|
||||
]
|
||||
|
@ -537,7 +537,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
new Combine([
|
||||
new Link(
|
||||
Utils.runningFromConsole
|
||||
? "<img src='https://mapcomplete.osm.be/assets/svg/statistics.svg' height='18px'>"
|
||||
? "<img src='https://mapcomplete.org/assets/svg/statistics.svg' height='18px'>"
|
||||
: Svg.statistics_svg().SetClass("w-4 h-4 mr-2"),
|
||||
"https://taginfo.openstreetmap.org/keys/" + values.key + "#values",
|
||||
true
|
||||
|
@ -574,7 +574,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
// This is for the documentation in a markdown-file, so we have to use raw HTML
|
||||
if (icon !== undefined) {
|
||||
iconImg = new FixedUiElement(
|
||||
`<img src='https://mapcomplete.osm.be/${icon}' height="100px"> `
|
||||
`<img src='https://mapcomplete.org/${icon}' height="100px"> `
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue