forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
f81532582c
142 changed files with 154335 additions and 632 deletions
|
@ -100,7 +100,7 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
|
|||
"_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] })()",
|
||||
"_comments_count=feat.get('comments').length",
|
||||
"_intro=(() => {const lines = feat.get('comments')[0].text.split('\\n'); lines.splice(feat.get('_trigger_index')-1, lines.length); return lines.filter(l => l !== '').join('<br/>');})()",
|
||||
"_tags=(() => {let lines = feat.properties['_first_comment'].split('\\n').map(l => l.trim()); lines.splice(0, feat.get('_trigger_index') + 1); lines = lines.filter(l => l != ''); return lines.join(';');})()"
|
||||
"_tags=(() => {let lines = feat.get('comments')[0].text.split('\\n').map(l => l.trim()); lines.splice(0, feat.get('_trigger_index') + 1); lines = lines.filter(l => l != ''); return lines.join(';');})()"
|
||||
],
|
||||
"isShown": {
|
||||
"render": "no",
|
||||
|
|
|
@ -121,6 +121,18 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
` Width = ${width} height = ${height}`;
|
||||
(json.hideFromOverview ? warnings : errors).push(e)
|
||||
}
|
||||
|
||||
const w = parseInt(width);
|
||||
const h = parseInt(height)
|
||||
if(w < 370 || h < 370){
|
||||
const e : string = [
|
||||
`the icon for theme ${json.id} is too small. Please rescale the icon at ${json.icon}`,
|
||||
`Even though an SVG is 'infinitely scaleable', the icon should be dimensioned bigger. One of the build steps of the theme does convert the image to a PNG (to serve as PWA-icon) and having a small dimension will cause blurry images.`,
|
||||
` Width = ${width} height = ${height}; we recommend a size of at least 500px * 500px and to use a square aspect ratio.`,
|
||||
].join("\n");
|
||||
(json.hideFromOverview ? warnings : errors).push(e)
|
||||
}
|
||||
|
||||
})
|
||||
} catch (e) {
|
||||
console.error("Could not read " + json.icon + " due to " + e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue