{
  "id": "mapcomplete-changes",
  "title": {
    "en": "Changes made with MapComplete"
  },
  "shortDescription": {
    "en": "Shows changes made by MapComplete"
  },
  "description": {
    "en": "This maps shows all the changes made with MapComplete"
  },
  "icon": "./assets/svg/logo.svg",
  "hideFromOverview": true,
  "startLat": 0,
  "startLon": 0,
  "startZoom": 1,
  "layers": [
    {
      "id": "mapcomplete-changes",
      "name": {
        "en": "Changeset centers"
      },
      "minzoom": 0,
      "source": {
        "osmTags": "editor~*",
        "geoJson": "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/mapcomplete-changes/tile_{z}_{x}_{y}.geojson",
        "geoJsonZoomLevel": 8
      },
      "title": {
        "render": {
          "en": "Changeset for {theme}"
        }
      },
      "description": {
        "en": "Shows all MapComplete changes"
      },
      "tagRenderings": [
        {
          "id": "show_changeset_id",
          "render": {
            "en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
          }
        },
        {
          "id": "contributor",
          "question": {
            "en": "What contributor did make this change?"
          },
          "freeform": {
            "key": "user"
          },
          "render": {
            "en": "Change made by <a href='https://openstreetmap.org/user/{user}' target='_blank'>{user}</a>"
          }
        },
        {
          "id": "theme-id",
          "question": {
            "en": "What theme was used to make this change?"
          },
          "freeform": {
            "key": "theme"
          },
          "render": {
            "en": "Change with theme <a href='https://mapcomplete.org/{theme}'>{theme}</a>"
          }
        },
        {
          "id": "locale",
          "freeform": {
            "key": "locale"
          },
          "question": {
            "en": "What locale (language) was this change made in?"
          },
          "render": {
            "en": "User locale is {locale}"
          }
        },
        {
          "id": "host",
          "render": {
            "en": "Change with with <a href='{host}'>{host}</a>"
          },
          "question": {
            "en": "What host (website) was this change made with?"
          },
          "freeform": {
            "key": "host"
          },
          "mappings": [
            {
              "if": "host=www.waldbrand-app.de",
              "then": "waldbrand-app.de",
              "hideInAnswer": true
            },
            {
              "if": "host~https://pietervdvn.github.io/mc/develop/.*",
              "then": "Develop",
              "hideInAnswer": true
            }
          ]
        },
        {
          "id": "version",
          "question": {
            "en": "What version of MapComplete was used to make this change?"
          },
          "render": {
            "en": "Made with {editor}"
          },
          "freeform": {
            "key": "editor"
          }
        }
      ],
      "pointRendering": [
        {
          "location": [
            "point",
            "centroid"
          ],
          "marker": [
            {
              "icon": {
                "render": "teardrop:#00cc00"
              }
            }
          ],
          "iconSize": "30,30",
          "anchor": "center"
        }
      ],
      "filter": [
        {
          "id": "theme-search",
          "options": [
            {
              "osmTags": "theme~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "Themename contains {search}"
              }
            }
          ]
        },
        {
          "id": "theme-not-search",
          "options": [
            {
              "osmTags": "theme!~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "Themename does <b>not</b> contain {search}"
              }
            }
          ]
        },
        {
          "id": "created_by",
          "options": [
            {
              "osmTags": "user~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "Made by contributor {search}"
              }
            }
          ]
        },
        {
          "id": "not_created_by",
          "options": [
            {
              "osmTags": "user!~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "<b>Not</b> made by contributor {search}"
              }
            }
          ]
        },
        {
          "id": "made_before",
          "options": [
            {
              "osmTags": "date<{search}",
              "fields": [
                {
                  "name": "search",
                  "type": "date"
                }
              ],
              "question": {
                "en": "Made before {search}"
              }
            }
          ]
        },
        {
          "id": "made_after",
          "options": [
            {
              "osmTags": "date>{search}",
              "fields": [
                {
                  "name": "search",
                  "type": "date"
                }
              ],
              "question": {
                "en": "Made after {search}"
              }
            }
          ]
        },
        {
          "id": "locale-filter",
          "options": [
            {
              "osmTags": "locale~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "User language (iso-code) {search}"
              }
            }
          ]
        },
        {
          "id": "host_name",
          "options": [
            {
              "osmTags": "host~i~.*{search}.*",
              "fields": [
                {
                  "name": "search"
                }
              ],
              "question": {
                "en": "Made with host {search}"
              }
            }
          ]
        },
        {
          "id": "added-image",
          "options": [
            {
              "osmTags": "add-image>0",
              "question": {
                "en": "Changeset added at least one image"
              }
            }
          ]
        },
        {
          "id": "exclude_grb",
          "options": [
            {
              "osmTags": "theme!=grb",
              "question": {
                "en": "Exclude GRB theme"
              }
            }
          ]
        },
        {
          "id": "exclude_etymology",
          "options": [
            {
              "osmTags": "theme!=etymology",
              "question": {
                "en": "Exclude etymology theme"
              }
            }
          ]
        }
      ]
    },
    {
      "builtin": "current_view",
      "override": {
        "title": "Statistics on changesets in the current view",
        "tagRenderings+": [
          {
            "id": "link_to_more",
            "render": {
              "en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
            }
          },
          {
            "id": "hist_themes",
            "render": "{histogram(_embedded_cs:themes, Themename, Number of changesets)}"
          },
          {
            "id": "hist_users",
            "render": "{histogram(_embedded_cs:users, Contributor, Number of changesets)}"
          }
        ],
        "calculatedTags": [
          "_embedded_cs=overlapWith(feat)('mapcomplete-changes').map(f => f.feat.properties)",
          "_embedded_cs:themes=feat.get('_embedded_cs').map(cs => cs.theme)",
          "_embedded_cs:users=feat.get('_embedded_cs').map(cs => cs['_last_edit:contributor'])"
        ],
        "+pointRendering": [
          {
            "location": [
              "point"
            ],
            "marker": [
              {
                "icon": "./assets/svg/statistics.svg"
              }
            ],
            "iconSize": "30,30",
            "anchor": "center"
          }
        ]
      }
    }
  ]
}