Browse Source

Move categories to repo openstreetbrowser-categories-main#branch-3.x

master
parent
commit
d82843a974
  1. 11
      categories/children.json
  2. 16
      categories/communication.json
  3. 11
      categories/gastro.json
  4. 43
      categories/index.json
  5. 14
      categories/parks.json
  6. 21
      categories/places.json
  7. 17
      categories/public.json
  8. 88
      categories/shop.json
  9. 24
      categories/trees.json
  10. 1
      conf.php-dist
  11. 5
      index.php
  12. 1
      package.json
  13. 2
      src/OpenStreetBrowserLoader.js

11
categories/children.json

@ -1,11 +0,0 @@
{
"type": "overpass",
"name:en": "Children",
"query": "(node[leisure~'^(playground|summer_camp|indoor_play)$'];way[leisure~'^(playground|summer_camp|indoor_play)$'];relation[leisure~'^(playground|summer_camp|indoor_play)$'];node[shop~'^(baby_goods|toys)$'];way[shop~'^(baby_goods|toys)$'];relation[shop~'^(baby_goods|toys)$'];node[amenity=toilets][diaper];way[amenity=toilets][diaper];relation[amenity=toilets][diaper];node[kids_area];way[kids_area];relation[kids_area];);",
"minZoom": 15,
"feature": {
"markerSign": "{% if tags.leisure=='playground' %}&#9977;{% elseif tags.leisure=='summer_camp'%}&#127957;{% elseif tags.leisure=='indoor_play' or tags.kids_area %}&#127968;{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}<i class=\"fa fa-shopping-cart\"></i>{% elseif tags.amenity=='toilets' and tags.diaper %}&#128701;&#128700;{% endif %}",
"body": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}",
"description": "{% if tags.leisure=='playground' %}{{ tagTrans('leisure', 'playground') }}{% elseif tags.leisure=='summer_camp'%}{{ tagTrans('leisure', 'summer_camp') }}{% elseif tags.leisure=='indoor_play' %}{{ tagTrans('leisure', 'indoor_play') }}{% elseif tags.kids_area %}{{ tagTrans('kids_area') }}{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{{ tagTrans('shop') }}: {{ tagTrans('shop', tags.shop) }}{% elseif tags.amenity=='toilets' and tags.diaper %}{{ tagTrans('amenity', 'toilets') }} with diaper changing table{% endif %}"
}
}

16
categories/communication.json

@ -1,16 +0,0 @@
{
"type": "overpass",
"name:en": "Communication",
"query": {
"13": "(node[amenity~'^(post_office|internet_cafe)$'];way[amenity~'^(post_office|internet_cafe)$'];relation[amenity~'^(post_office|internet_cafe)$'];);",
"16": "(node[amenity~'^(post_office|internet_cafe|post_box|telephone)$'];way[amenity~'^(post_office|internet_cafe)$'];relation[amenity~'^(post_office|internet_cafe)$'];);"
},
"minZoom": 13,
"feature": {
"title": "{{ tags.name|default(tags.operator)|default(tagTrans('amenity', tags.amenity)) }}",
"markerSign": "{% if tags.amenity=='post_office' %}&#127972;{% elseif tags.amenity=='post_box'%}&#128238;{% elseif tags.amenity=='internet_cafe' %}&#128187;{% elseif tags.amenity=='telephone' %}&#9990;{% endif %}",
"body": "{{ tagTrans('amenity', tags.amenity) }}<br/>{% if tags.operator %}Operator: {{ tags.operator }}<br/>{% endif %}",
"description": "{{ tagTrans('amenity', tags.amenity) }}"
}
}

11
categories/gastro.json

@ -1,11 +0,0 @@
{
"type": "overpass",
"name:en": "Gastronomy",
"query": "(node[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];way[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];relation[amenity~'^(bar|biergarten|cafe|fast_food|ice_cream|pub|restaurant)$'];);",
"minZoom": 16,
"feature": {
"markerSign": "{% if tags.amenity=='bar' %}&#127864;{% elseif tags.amenity=='biergarten'%}&#127867;{% elseif tags.amenity=='cafe' %}&#9749;{% elseif tags.amenity=='fast_food' %}&#127828;{% elseif tags.amenity=='ice_cream' %}&#127848;{% elseif tags.amenity=='pub' %}&#127866;{% else %}&#127860;{% endif %}",
"body": "{{ tagTrans('amenity', tags.amenity) }}<br/>{{ tagTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default('unknown') }}",
"description": "{{ tagTrans('amenity', tags.amenity) }}"
}
}

43
categories/index.json

@ -1,43 +0,0 @@
{
"type": "index",
"subCategories": [
{
"id": "leisure",
"type": "index",
"name:en": "Leisure, Sport and Shopping",
"subCategories": [
{
"id": "gastro"
},
{
"id": "shop"
},
{
"id": "children"
}
]
},
{
"id": "services",
"type": "index",
"name:en": "Services",
"subCategories": [
{
"id": "communication"
},
{
"id": "public"
}
]
},
{
"id": "trees"
},
{
"id": "parks"
},
{
"id": "places"
}
]
}

14
categories/parks.json

@ -1,14 +0,0 @@
{
"type": "overpass",
"name:en": "Parks",
"query": "(way[leisure=park];relation[leisure=park];)",
"minZoom": 14,
"feature": {
"style": {
"color": "green",
"fillColor": "green",
"fillOpacity": 0.2,
"weight": 2
}
}
}

21
categories/places.json

@ -1,21 +0,0 @@
{
"type": "overpass",
"name:en": "Places",
"query": {
"0": "node[place~'^(continent)$']",
"4": "node[place~'^(continent|country)$']",
"6": "node[place~'^(country|city)$']",
"8": "node[place~'^(country|city|state)$']",
"11": "node[place~'^(city|state|region|town|village)$']",
"13": "node[place~'^(city|state|region|town|village|suburb|hamlet|quarter)$']",
"15": "node[place~'^(city|region|town|village|suburb|hamlet|quarter)$']",
"16": "(node[place~'^(region|town|village|suburb|hamlet|quarter|islet|isolated_dwelling|neighbourhood|farm)$'];way[place~'^(isolated_dwelling|neighbourhood|farm)$'];relation[place~'^(isolated_dwelling|neighbourhood|farm)$'];);"
},
"minZoom": 0,
"feature": {
"title": "{% set loc_name = localizedTag(tags, 'name') %}{{ loc_name }}{% if loc_name != tags.name %} ({{ tags.name }}){% endif %}",
"body": "{{ tagTrans('place', tags.place) }}\n{% if tags.population %}<br/>{{ tagTrans('population') }}: {{ tags.population }}{% endif %} \n",
"description": "{{ tagTrans('place', tags.place) }}",
"priority": "{% set priorities = { 'continent': 0, 'country': 1, 'state': 2, 'region': 3, 'city': 4, 'town': 5, 'village': 6, 'suburb': 7, 'hamlet': 8, 'quarter': 9, neighbourhood: 10, 'isolated_dwelling': 11, 'farm': 12 } %}{{ priorities[tags.place] }}"
}
}

17
categories/public.json

@ -1,17 +0,0 @@
{
"type": "overpass",
"name:en": "Public Services",
"query": {
"12": "(node[amenity~'^(court_house|embassy|public_building|townhall)$'];way[amenity~'^(court_house|embassy|public_building|townhall)$'];relation[amenity~'^(court_house|embassy|public_building|townhall)$'];node[amenity=recycling][recyling_type=centre];way[amenity=recycling][recyling_type=centre];relation[amenity=recycling][recyling_type=centre];);",
"16": "(node[amenity~'^(court_house|embassy|public_building|townhall|clock|drinking_water|recycling)$'];way[amenity~'^(court_house|embassy|public_building|townhall|recycling)$'];relation[amenity~'^(court_house|embassy|public_building|townhall|recycling)$'];node[drinking_water]);"
},
"minZoom": 12,
"feature": {
"title": "{{ tags.name|default(tags.operator)|default(tagTrans('amenity', tags.amenity)) }}",
"markerSign": "{% if tags.amenity=='post_office' %}&#127972;{% elseif tags.amenity=='post_box'%}&#128238;{% elseif tags.amenity=='internet_cafe' %}&#128187;{% elseif tags.amenity=='telephone' %}&#9990;{% endif %}",
"body": "{{ tagTrans('amenity', tags.amenity) }}<br/>{% if tags.operator %}Operator: {{ tags.operator }}<br/>{% endif %}",
"description": "{{ tagTrans('amenity', tags.amenity) }}"
}
}

88
categories/shop.json

@ -1,88 +0,0 @@
{
"type": "overpass",
"name:en": "Shopping",
"query": {
"14": "(node[shop~'^(mall|department_store)$'];way[shop~'^(mall|department_store)$'];relation[shop~'^(mall|department_store)$'];);",
"16": "(node[shop];way[shop];relation[shop];);"
},
"minZoom": 14,
"feature": {
"pre": "{% set shop0 = tags.shop|split(';')[0] %}{% set current = const.default %}{% for v in const.shops %}{% if shop0 in v.types %}{% set current = v %}{% endif %}{% endfor %}",
"body": "{{ tagTransList('shop', tags.shop) }}",
"description": "{{ tagTransList('shop', tags.shop) }}",
"markerSign": "{% set c = current.sign %}{% if c|slice(0, 3) == 'fa-' %}<i class=\"fa {{ c }}\"></i>{% else %}{{ c|raw }}{% endif %}",
"__": "need better icons for: bakery, butcher, cheese, ice_cream, ",
"__": "no icons for: brewing_supplies, charity, second_hand, variety_store"
},
"const": {
"default": {
"sign": "fa-shopping-bag"
},
"shops": [
{
"types": [ "alcohol", "beverages" ],
"sign": "fa-beer"
},
{
"types": [ "baby_goods" ],
"sign": "&#128700;"
},
{
"types": [ "bag", "general" ],
"sign": "fa-shopping-bag"
},
{
"types": [ "bakery", "confectionery", "pastry" ],
"sign": "fa-birthday-cake"
},
{
"types": [ "boutique", "clothes", "fabric", "fashion", "leather", "sewing", "tailor" ],
"sign": "&#128090;"
},
{
"types": [ "butcher", "cheese", "chocolate", "deli", "dairy", "farm", "greengrocer", "pasta", "spices" ],
"sign": "fa-cutlery"
},
{
"types": [ "coffee", "tea" ],
"sign": "fa-coffee"
},
{
"types": [ "convenience" ],
"sign": "fa-shopping-basket"
},
{
"types": [ "department_store", "mall" ],
"sign": "fa-building"
},
{
"types": [ "hairdresser" ],
"sign": "&#128113;"
},
{
"types": [ "ice_cream" ],
"sign": "&#127848;"
},
{
"types": [ "jewelry" ],
"sign": "&#128141;"
},
{
"types": [ "kiosk" ],
"sign": "fa-newspaper-o"
},
{
"types": [ "shoes" ],
"sign": "&#128095;"
},
{
"types": [ "supermarket" ],
"sign": "fa-shopping-cart"
},
{
"types": [ "watches" ],
"sign": "&#8986;"
}
]
}
}

24
categories/trees.json

@ -1,24 +0,0 @@
{
"type": "overpass",
"name:en": "Trees",
"query": "node[natural=tree];",
"minZoom": 17,
"feature": {
"title": "{% if tags.ref %}{{ tags.ref }} - {% endif %}{{ tags.name|default('Tree') }}",
"description": "{{ tags.species }}",
"body": "{{ tags.species }}",
"style": {
"nodeFeature": "CircleMarker",
"color": "red",
"fillColor": "red",
"fillOpacity": 0.1,
"weight": 1,
"radius": 6
},
"marker": {
"iconUrl": "img/map_pointer.png",
"iconSize": [ 25, 42 ],
"iconAnchor": [ 13, 42 ]
}
}
}

1
conf.php-dist

@ -1 +1,2 @@
<?php
$categories_dir = 'node_modules/openstreetbrowser-categories-main';

5
index.php

@ -1,6 +1,11 @@
<?php include "conf.php"; /* load a local configuration */ ?>
<?php include "modulekit/loader.php"; /* loads all php-includes */ ?>
<?php call_hooks("init"); /* initialize submodules */ ?>
<?php
html_export_var(array(
'categories_dir' => $categories_dir,
));
?>
<!DOCTYPE html>
<html>
<head>

1
package.json

@ -12,6 +12,7 @@
"leaflet": "^1.0.3",
"leaflet-geosearch": "^2.4.0",
"leaflet.locatecontrol": "^0.61.0",
"openstreetbrowser-categories-main": "https://github.com/plepe/openstreetbrowser-categories-main#branch-3.x",
"openstreetmap-tag-translations": "^1.0.0",
"overpass-layer": "https://github.com/plepe/overpass-layer#marker",
"sheet-router": "^4.2.3"

2
src/OpenStreetBrowserLoader.js

@ -33,7 +33,7 @@ OpenStreetBrowserLoader.prototype.getCategory = function (id, callback) {
var req = new XMLHttpRequest()
req.addEventListener("load", reqListener.bind(this, req))
req.open("GET", "categories/" + id + ".json")
req.open("GET", categories_dir + '/' + id + ".json")
req.send()
}

Loading…
Cancel
Save