From d82843a974d8d5948132dbd15289c2114c83a533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 29 Jun 2017 22:02:00 +0200 Subject: [PATCH] Move categories to repo openstreetbrowser-categories-main#branch-3.x --- categories/children.json | 11 ----- categories/communication.json | 16 ------- categories/gastro.json | 11 ----- categories/index.json | 43 ----------------- categories/parks.json | 14 ------ categories/places.json | 21 -------- categories/public.json | 17 ------- categories/shop.json | 88 ---------------------------------- categories/trees.json | 24 ---------- conf.php-dist | 1 + index.php | 5 ++ package.json | 1 + src/OpenStreetBrowserLoader.js | 2 +- 13 files changed, 8 insertions(+), 246 deletions(-) delete mode 100644 categories/children.json delete mode 100644 categories/communication.json delete mode 100644 categories/gastro.json delete mode 100644 categories/index.json delete mode 100644 categories/parks.json delete mode 100644 categories/places.json delete mode 100644 categories/public.json delete mode 100644 categories/shop.json delete mode 100644 categories/trees.json diff --git a/categories/children.json b/categories/children.json deleted file mode 100644 index 82b4c2f9..00000000 --- a/categories/children.json +++ /dev/null @@ -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' %}⛹{% elseif tags.leisure=='summer_camp'%}🏕{% elseif tags.leisure=='indoor_play' or tags.kids_area %}🏠{% elseif tags.shop=='baby_goods' or tags.shop=='toys' %}{% elseif tags.amenity=='toilets' and tags.diaper %}🚽🚼{% 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 %}" - } -} diff --git a/categories/communication.json b/categories/communication.json deleted file mode 100644 index 652156c6..00000000 --- a/categories/communication.json +++ /dev/null @@ -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' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}Operator: {{ tags.operator }}
{% endif %}", - "description": "{{ tagTrans('amenity', tags.amenity) }}" - } -} - diff --git a/categories/gastro.json b/categories/gastro.json deleted file mode 100644 index a5f1c291..00000000 --- a/categories/gastro.json +++ /dev/null @@ -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' %}🍸{% elseif tags.amenity=='biergarten'%}🍻{% elseif tags.amenity=='cafe' %}☕{% elseif tags.amenity=='fast_food' %}🍔{% elseif tags.amenity=='ice_cream' %}🍨{% elseif tags.amenity=='pub' %}🍺{% else %}🍴{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{{ tagTrans('cuisine') }}: {{ tagTransList('cuisine', tags.cuisine)|default('unknown') }}", - "description": "{{ tagTrans('amenity', tags.amenity) }}" - } -} diff --git a/categories/index.json b/categories/index.json deleted file mode 100644 index 04c8c973..00000000 --- a/categories/index.json +++ /dev/null @@ -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" - } - ] -} diff --git a/categories/parks.json b/categories/parks.json deleted file mode 100644 index 3972fb75..00000000 --- a/categories/parks.json +++ /dev/null @@ -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 - } - } -} diff --git a/categories/places.json b/categories/places.json deleted file mode 100644 index ba8b953d..00000000 --- a/categories/places.json +++ /dev/null @@ -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 %}
{{ 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] }}" - } -} diff --git a/categories/public.json b/categories/public.json deleted file mode 100644 index ded77b90..00000000 --- a/categories/public.json +++ /dev/null @@ -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' %}🏤{% elseif tags.amenity=='post_box'%}📮{% elseif tags.amenity=='internet_cafe' %}💻{% elseif tags.amenity=='telephone' %}✆{% endif %}", - "body": "{{ tagTrans('amenity', tags.amenity) }}
{% if tags.operator %}Operator: {{ tags.operator }}
{% endif %}", - "description": "{{ tagTrans('amenity', tags.amenity) }}" - } -} - - diff --git a/categories/shop.json b/categories/shop.json deleted file mode 100644 index e714aa95..00000000 --- a/categories/shop.json +++ /dev/null @@ -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-' %}{% 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": "🚼" - }, - { - "types": [ "bag", "general" ], - "sign": "fa-shopping-bag" - }, - { - "types": [ "bakery", "confectionery", "pastry" ], - "sign": "fa-birthday-cake" - }, - { - "types": [ "boutique", "clothes", "fabric", "fashion", "leather", "sewing", "tailor" ], - "sign": "👚" - }, - { - "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": "👱" - }, - { - "types": [ "ice_cream" ], - "sign": "🍨" - }, - { - "types": [ "jewelry" ], - "sign": "💍" - }, - { - "types": [ "kiosk" ], - "sign": "fa-newspaper-o" - }, - { - "types": [ "shoes" ], - "sign": "👟" - }, - { - "types": [ "supermarket" ], - "sign": "fa-shopping-cart" - }, - { - "types": [ "watches" ], - "sign": "⌚" - } - ] - } -} diff --git a/categories/trees.json b/categories/trees.json deleted file mode 100644 index 494a7c00..00000000 --- a/categories/trees.json +++ /dev/null @@ -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 ] - } - } -} diff --git a/conf.php-dist b/conf.php-dist index b3d9bbc7..9c9e24ba 100644 --- a/conf.php-dist +++ b/conf.php-dist @@ -1 +1,2 @@ + $categories_dir, +)); +?> diff --git a/package.json b/package.json index 881ed974..1a7e4ea2 100644 --- a/package.json +++ b/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" diff --git a/src/OpenStreetBrowserLoader.js b/src/OpenStreetBrowserLoader.js index a1f29138..38bf8dbe 100644 --- a/src/OpenStreetBrowserLoader.js +++ b/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() }