Add theme for 'notes'

This commit is contained in:
Pieter Vander Vennet 2022-01-08 04:22:50 +01:00
parent 677a07e3d2
commit a58ce564c2
20 changed files with 678 additions and 314 deletions

View file

@ -1,18 +0,0 @@
[
{
"path": "note.svg",
"license": "CC0",
"authors": [
"Pieter Vander Vennet"
],
"sources": []
},
{
"path": "resolved.svg",
"license": "CC0",
"authors": [
"Pieter Vander Vennet"
],
"sources": []
}
]

View file

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="275px"
height="374px"
viewBox="0 0 275 374"
version="1.1"
id="svg7"
sodipodi:docname="teardrop.svg"
inkscape:version="1.1.1 (1:1.1+202109281949+c3084ef5ed)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs11" />
<sodipodi:namedview
id="namedview9"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="false"
inkscape:zoom="1.8073494"
inkscape:cx="80.227983"
inkscape:cy="144.13372"
inkscape:current-layer="svg7">
<sodipodi:guide
position="137.32093,125.42369"
orientation="1,0"
id="guide2177" />
</sodipodi:namedview>
<path
id="path2"
style="fill:#c60000;fill-opacity:1;fill-rule:nonzero;stroke:#950000;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 135.55664 1.9765625 C 74.593645 2.1922681 20.084472 43.910648 7.2773438 104.37109 C 4.936895 115.41704 4.1435422 126.42334 4.7265625 137.18555 C 2.5821353 205.89923 56.815085 269.30423 107.08203 335.96094 C 119.40234 351.22656 136.60547 368.02734 137.43359 370.03516 L 165.07812 337.42188 C 227.98632 255.40992 319.84389 135.74148 238.04492 49.080078 C 219.42005 26.853995 193.07863 10.556457 161.97656 4.4921875 C 153.10693 2.7626953 144.26564 1.9457474 135.55664 1.9765625 z " />
<path
id="path5936"
style="color:#000000;fill:#fffffd;stroke:#000000;stroke-width:5;stroke-linecap:round;stroke-opacity:1;fill-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 202.54602,49.933374 a 19.846225,19.846225 0 0 0 -14.03347,5.812789 L 137.36365,106.89506 86.838795,56.370195 a 19.845967,19.845967 0 0 0 -14.033473,-5.812787 19.845967,19.845967 0 0 0 -14.033471,5.812787 19.845967,19.845967 0 0 0 0,28.066944 l 50.524859,50.524871 -50.328371,50.32837 a 19.846225,19.846225 0 0 0 0,28.06695 19.846225,19.846225 0 0 0 28.066944,0 l 50.328367,-50.32838 50.95423,50.95424 a 19.845967,19.845967 0 0 0 28.06694,0 19.845967,19.845967 0 0 0 0,-28.06695 L 165.4306,134.96201 216.57949,83.813106 a 19.846225,19.846225 0 0 0 0,-28.066943 19.846225,19.846225 0 0 0 -14.03347,-5.812789 z" />
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -9,8 +9,8 @@
"startZoom": 0,
"title": "Notes on OpenStreetMap",
"version": "0.1",
"description": "Notes from OpenStreetMap",
"icon": "./assets/themes/notes/resolved.svg",
"description": "A note is a pin on the map with some text to indicate something wrong.<br/><br/>Make sure to checkout the <a href='#filters'>filter view</a> to search for users and text.",
"icon": "./assets/svg/resolved.svg",
"clustering": false,
"enableDownload": true,
"layers": [
@ -19,7 +19,7 @@
"name": {
"en": "OpenStreetMap notes"
},
"description": "Notes on OpenStreetMap.org",
"description": "This layer shows notes on OpenStreetMap.",
"source": {
"osmTags": "id~*",
"geoJson": "https://api.openstreetmap.org/api/0.6/notes.json?closed=7&bbox={x_min},{y_min},{x_max},{y_max}",
@ -42,7 +42,10 @@
},
"calculatedTags": [
"_first_comment:=feat.get('comments')[0].text.toLowerCase()",
"_conversation=feat.get('comments').map(c => { let user = 'anonymous user'; if(c.user_url !== undefined){user = '<a href=\"'+c.user_url+'\" target=\"_blank\">'+c.user+'</a>'}; return c.html +'<div class=\"subtle flex justify-end border-t border-gray-500\">' + user + '&nbsp;'+c.date+'</div>' }).join('')"
"_opened_by_anonymous_user:=feat.get('comments')[0].user === undefined",
"_first_user:=feat.get('comments')[0].user",
"_first_user_lc:=feat.get('comments')[0].user?.toLowerCase()",
"_first_user_id:=feat.get('comments')[0].uid"
],
"titleIcons": [
{
@ -52,18 +55,18 @@
"tagRenderings": [
{
"id": "conversation",
"render": "{_conversation}"
"render": "{visualize_note_comments()}"
},
{
"id": "date_created",
"id": "comment",
"render": "{add_note_comment()}"
},
{
"id": "Spam",
"render": {
"en": "Opened on {date_created}"
}
},
{
"id": "close",
"render": "{close_note()}",
"condition": "closed_at="
"en": "<a href='https://www.openstreetmap.org/reports/new?reportable_id={_first_user_id}&reportable_type=User' target='_blank' class='subtle'>Report {_first_user} as spam</a>"
},
"condition": "_opened_by_anonymous_user=false"
}
],
"mapRendering": [
@ -73,11 +76,11 @@
"centroid"
],
"icon": {
"render": "./assets/themes/notes/note.svg",
"render": "./assets/svg/note.svg",
"mappings": [
{
"if": "closed_at~*",
"then": "./assets/themes/notes/resolved.svg"
"then": "./assets/svg/resolved.svg"
}
]
},
@ -116,6 +119,49 @@
}
}
]
},
{
"id": "opened_by",
"options": [
{
"osmTags": "_first_user_lc~.*{search}.*",
"fields": [
{
"name": "search"
}
],
"question": {
"en": "Opened by {search}"
}
}
]
},
{
"id": "not_opened_by",
"options": [
{
"osmTags": "_first_user_lc!~.*{search}.*",
"fields": [
{
"name": "search"
}
],
"question": {
"en": "<b>Not</b> opened by {search}"
}
}
]
},
{
"id": "anonymous",
"options": [
{
"osmTags": "_opened_by_anonymous_user=true",
"question": {
"en": "Opened by anonymous user"
}
}
]
}
]
}

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="275px"
height="374px"
viewBox="0 0 275 374"
version="1.1"
id="svg7"
sodipodi:docname="resolved.svg"
inkscape:version="1.1.1 (1:1.1+202109281949+c3084ef5ed)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs11" />
<sodipodi:namedview
id="namedview9"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="false"
inkscape:zoom="2.2793262"
inkscape:cx="68.44128"
inkscape:cy="162.54804"
inkscape:current-layer="svg7">
<sodipodi:guide
position="137.32093,125.42369"
orientation="1,0"
id="guide2177" />
</sodipodi:namedview>
<path
id="path2"
style="fill:#00c82e;fill-opacity:1;fill-rule:nonzero;stroke:#40ff00;stroke-width:5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 135.55664 1.9765625 C 74.593645 2.1922681 20.084472 43.910648 7.2773438 104.37109 C 4.936895 115.41704 4.1435422 126.42334 4.7265625 137.18555 C 2.5821353 205.89923 56.815085 269.30423 107.08203 335.96094 C 119.40234 351.22656 136.60547 368.02734 137.43359 370.03516 L 165.07812 337.42188 C 227.98632 255.40992 319.84389 135.74148 238.04492 49.080078 C 219.42005 26.853995 193.07863 10.556457 161.97656 4.4921875 C 153.10693 2.7626953 144.26564 1.9457474 135.55664 1.9765625 z " />
<path
style="color:#000000;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:3.52437;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 216.35763,81.457377 c -6.31364,-1.014444 -12.65279,1.657101 -16.62944,7.00824 L 117.3564,199.32492 69.393978,152.33285 c -7.532586,-9.1813 -20.4662,-9.07329 -27.311559,-1.91781 -7.087039,7.56459 -8.507731,17.24412 -0.648456,25.76692 l 61.942427,65.80658 c 7.15464,9.62634 20.80539,9.62634 27.96003,0 l 96.3518,-129.67383 c 6.14683,-8.27231 4.87072,-20.317183 -2.85026,-26.902908 -2.45389,-2.092661 -5.37864,-3.456485 -8.48033,-3.954425 z"
id="path3639"
sodipodi:nodetypes="ccccccccccc" />
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB