forked from MapComplete/MapComplete
Import work
This commit is contained in:
parent
42a6b37ca6
commit
e0b58a0f55
3 changed files with 68 additions and 4 deletions
54
assets/layers/note_import/note_import.json
Normal file
54
assets/layers/note_import/note_import.json
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"id": "note_import",
|
||||
"description": "Te template for note note imports.",
|
||||
"source": {
|
||||
"osmTags": {
|
||||
"and": ["id~*"
|
||||
]
|
||||
},
|
||||
"geoJson": "https://api.openstreetmap.org/api/0.6/notes.json?closed=7&bbox={x_min},{y_min},{x_max},{y_max}",
|
||||
"geoJsonZoomLevel": 12,
|
||||
"maxCacheAge": 0
|
||||
},
|
||||
"minzoom": 10,
|
||||
"title": {
|
||||
"render": {
|
||||
"en": "Possible feature"
|
||||
}
|
||||
},
|
||||
"calculatedTags": [
|
||||
"_first_comment:=feat.get('comments')[0].text.toLowerCase()",
|
||||
"_is_import_comment:=(() => {const parsed = feat.properties._first_comment.match('\\(.*\\)https:\\/\\/mapcomplete\\.osm\\.be\\/\\([a-zA-Z0-9_-]*\\)[^\\n]*}')()"
|
||||
],
|
||||
"titleIcons": [
|
||||
{
|
||||
"render": "<a href='https://openstreetmap.org/note/{id}' target='_blank'><img src='./assets/svg/osm-logo-us.svg'></a>"
|
||||
}
|
||||
],
|
||||
"tagRenderings": [
|
||||
{
|
||||
"id": "conversation",
|
||||
"render": "{visualize_note_comments()}"
|
||||
},
|
||||
{
|
||||
"id": "add_image",
|
||||
"render": "{add_image_to_note()}"
|
||||
},
|
||||
{
|
||||
"id": "comment",
|
||||
"render": "{add_note_comment()}"
|
||||
}
|
||||
],
|
||||
"mapRendering": [
|
||||
{
|
||||
"location": [
|
||||
"point",
|
||||
"centroid"
|
||||
],
|
||||
"icon": {
|
||||
"render": "teardrop:#3333cc"
|
||||
},
|
||||
"iconSize": "40,40,bottom"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -43,6 +43,7 @@
|
|||
"startZoom": 1,
|
||||
"widenFactor": 1,
|
||||
"layers": [
|
||||
"public_bookcase"
|
||||
"public_bookcase",
|
||||
"note_import"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue