2023-01-24 09:37:03 +00:00
|
|
|
import { indexOf } from 'lodash';
|
2023-01-26 15:48:59 +00:00
|
|
|
import { Feature } from 'ol';
|
2023-01-24 09:37:03 +00:00
|
|
|
|
2023-06-09 10:21:11 +00:00
|
|
|
export const osmTags = {
|
|
|
|
bar: { name: 'amenity', value: 'bar' },
|
|
|
|
fast_food: { name: 'amenity', value: 'fast_food' },
|
|
|
|
food_court: { name: 'amenity', value: 'food_court' },
|
|
|
|
pub: { name: 'amenity', value: 'pub' },
|
|
|
|
restaurant: { name: 'amenity', value: 'restaurant' },
|
|
|
|
cafe: { name: 'amenity', value: 'cafe' },
|
|
|
|
atm: { name: 'amenity', value: 'atm' },
|
|
|
|
bank: { name: 'amenity', value: 'bank' },
|
|
|
|
doctors: { name: 'amenity', value: 'doctors' },
|
|
|
|
hospital: { name: 'amenity', value: 'hospital' },
|
|
|
|
pharmacy: { name: 'amenity', value: 'pharmacy' },
|
|
|
|
police: { name: 'amenity', value: 'police' },
|
|
|
|
fire_station: { name: 'amenity', value: 'fire_station' },
|
|
|
|
drinking_water: { name: 'amenity', value: 'drinking_water' },
|
|
|
|
water_point: { name: 'amenity', value: 'water_point' },
|
|
|
|
waste_basket: { name: 'amenity', value: 'waste_basket' },
|
|
|
|
waste_disposal: { name: 'amenity', value: 'waste_disposal' },
|
|
|
|
vending_machine: { name: 'amenity', value: 'vending_machine' },
|
|
|
|
bicycle_parking: { name: 'amenity', value: 'bicycle_parking' },
|
|
|
|
parking: { name: 'amenity', value: 'parking' },
|
|
|
|
bakery: { name: 'shop', value: 'bakery' },
|
|
|
|
butcher: { name: 'shop', value: 'butcher' },
|
|
|
|
cheese: { name: 'shop', value: 'cheese' },
|
|
|
|
chocolate: { name: 'shop', value: 'chocolate' },
|
|
|
|
convenience: { name: 'shop', value: 'convenience' },
|
|
|
|
dairy: { name: 'shop', value: 'dairy' },
|
|
|
|
farm: { name: 'shop', value: 'farm' },
|
|
|
|
greengrocer: { name: 'shop', value: 'greengrocer' },
|
|
|
|
health_food: { name: 'shop', value: 'health_food' },
|
|
|
|
pasta: { name: 'shop', value: 'pasta' },
|
|
|
|
pastry: { name: 'shop', value: 'pastry' },
|
|
|
|
seafood: { name: 'shop', value: 'seafood' },
|
|
|
|
water: { name: 'shop', value: 'water' },
|
|
|
|
department_store: { name: 'shop', value: 'department_store' },
|
|
|
|
general: { name: 'shop', value: 'general' },
|
|
|
|
mall: { name: 'shop', value: 'mall' },
|
|
|
|
supermarket: { name: 'shop', value: 'supermarket' },
|
|
|
|
wholesale: { name: 'shop', value: 'wholesale' },
|
|
|
|
outdoor: { name: 'shop', value: 'outdoor' },
|
|
|
|
laundry: { name: 'shop', value: 'laundry' },
|
|
|
|
hotel: { name: 'tourism', value: 'hotel' },
|
|
|
|
alpine_hut: { name: 'tourism', value: 'alpine_hut' },
|
|
|
|
apartment: { name: 'tourism', value: 'apartment' },
|
|
|
|
camp_site: { name: 'tourism', value: 'camp_site' },
|
|
|
|
chalet: { name: 'tourism', value: 'chalet' },
|
|
|
|
guest_house: { name: 'tourism', value: 'guest_house' },
|
|
|
|
hostel: { name: 'tourism', value: 'hostel' },
|
|
|
|
motel: { name: 'tourism', value: 'motel' },
|
|
|
|
wilderness_hut: { name: 'tourism', value: 'wilderness_hut' },
|
|
|
|
viewpoint: { name: 'tourism', value: 'viewpoint' },
|
|
|
|
waterfall: { name: 'waterway', value: 'waterfall' },
|
|
|
|
peak: { name: 'natural', value: 'peak' },
|
|
|
|
cave_entrance: { name: 'natural', value: 'cave_entrance' },
|
|
|
|
volcano: { name: 'natural', value: 'volcano' },
|
|
|
|
arch: { name: 'natural', value: 'arch' },
|
|
|
|
arete: { name: 'natural', value: 'arete' },
|
|
|
|
fumarole: { name: 'natural', value: 'fumarole' },
|
|
|
|
rock: { name: 'natural', value: 'rock' },
|
|
|
|
saddle: { name: 'natural', value: 'saddle' },
|
|
|
|
sinkhole: { name: 'natural', value: 'sinkhole' },
|
|
|
|
stone: { name: 'natural', value: 'stone' },
|
|
|
|
glacier: { name: 'natural', value: 'glacier' },
|
|
|
|
spring: { name: 'natural', value: 'spring' },
|
|
|
|
hot_spring: { name: 'natural', value: 'hot_spring' },
|
|
|
|
geyser: { name: 'natural', value: 'geyser' },
|
|
|
|
};
|
|
|
|
|
2023-06-09 09:05:07 +00:00
|
|
|
export const overlayDefinitions = {
|
|
|
|
hiking: {
|
2023-06-09 10:21:11 +00:00
|
|
|
drinking: ['bar', 'pub', 'cafe', 'drinking_water', 'water_point', 'water'],
|
|
|
|
eating: [
|
|
|
|
'fast_food',
|
|
|
|
'food_court',
|
|
|
|
'pub',
|
|
|
|
'restaurant',
|
|
|
|
'bakery',
|
|
|
|
'butcher',
|
|
|
|
'cheese',
|
|
|
|
'chocolate',
|
|
|
|
'convenience',
|
|
|
|
'dairy',
|
|
|
|
'farm',
|
|
|
|
'greengrocer',
|
|
|
|
'health_food',
|
|
|
|
'pasta',
|
|
|
|
'pastry',
|
|
|
|
'seafood',
|
|
|
|
'supermarket',
|
|
|
|
'wholesale',
|
|
|
|
'outdoor',
|
|
|
|
],
|
|
|
|
money: ['atm', 'bank'],
|
|
|
|
dayToDay: [
|
|
|
|
'atm',
|
|
|
|
'bank',
|
|
|
|
'waste_basket',
|
|
|
|
'waste_disposal',
|
|
|
|
'vending_machine',
|
|
|
|
'department_store',
|
|
|
|
'general',
|
|
|
|
'mall',
|
|
|
|
'laundry',
|
|
|
|
],
|
|
|
|
health: ['doctors', 'hospital', 'pharmacy'],
|
|
|
|
security: ['police', 'fire_station'],
|
|
|
|
sleeping: [
|
|
|
|
'hotel',
|
|
|
|
'alpine_hut',
|
|
|
|
'apartment',
|
|
|
|
'camp_site',
|
|
|
|
'chalet',
|
|
|
|
'guest_house',
|
|
|
|
'hostel',
|
|
|
|
'motel',
|
|
|
|
'wilderness_hut',
|
|
|
|
],
|
|
|
|
naturalSites: [
|
|
|
|
'viewpoint',
|
|
|
|
'waterfall',
|
|
|
|
'peak',
|
|
|
|
'cave_entrance',
|
|
|
|
'volcano',
|
|
|
|
'arch',
|
|
|
|
'arete',
|
|
|
|
'fumarole',
|
|
|
|
'rock',
|
|
|
|
'saddle',
|
|
|
|
'sinkhole',
|
|
|
|
'stone',
|
|
|
|
'glacier',
|
|
|
|
'spring',
|
|
|
|
'hot_spring',
|
|
|
|
'geyser',
|
|
|
|
],
|
2023-06-09 09:05:07 +00:00
|
|
|
},
|
|
|
|
cycling: {
|
2023-06-09 10:21:11 +00:00
|
|
|
drinking: ['bar', 'pub', 'cafe', 'drinking_water', 'water_point', 'water'],
|
|
|
|
eating: [
|
|
|
|
'fast_food',
|
|
|
|
'food_court',
|
|
|
|
'pub',
|
|
|
|
'restaurant',
|
|
|
|
'bakery',
|
|
|
|
'butcher',
|
|
|
|
'cheese',
|
|
|
|
'chocolate',
|
|
|
|
'convenience',
|
|
|
|
'dairy',
|
|
|
|
'farm',
|
|
|
|
'greengrocer',
|
|
|
|
'health_food',
|
|
|
|
'pasta',
|
|
|
|
'pastry',
|
|
|
|
'seafood',
|
|
|
|
'supermarket',
|
|
|
|
'wholesale',
|
|
|
|
'outdoor',
|
|
|
|
],
|
|
|
|
money: ['atm', 'bank'],
|
|
|
|
dayToDay: [
|
|
|
|
'atm',
|
|
|
|
'bank',
|
|
|
|
'waste_basket',
|
|
|
|
'waste_disposal',
|
|
|
|
'vending_machine',
|
|
|
|
'department_store',
|
|
|
|
'general',
|
|
|
|
'mall',
|
|
|
|
'laundry',
|
|
|
|
],
|
|
|
|
health: ['doctors', 'hospital', 'pharmacy'],
|
|
|
|
security: ['police', 'fire_station'],
|
|
|
|
parking: ['bicycle_parking'],
|
|
|
|
sleeping: [
|
|
|
|
'hotel',
|
|
|
|
'alpine_hut',
|
|
|
|
'apartment',
|
|
|
|
'camp_site',
|
|
|
|
'chalet',
|
|
|
|
'guest_house',
|
|
|
|
'hostel',
|
|
|
|
'motel',
|
|
|
|
'wilderness_hut',
|
|
|
|
],
|
|
|
|
naturalSites: [
|
|
|
|
'viewpoint',
|
|
|
|
'waterfall',
|
|
|
|
'peak',
|
|
|
|
'cave_entrance',
|
|
|
|
'volcano',
|
|
|
|
'arch',
|
|
|
|
'arete',
|
|
|
|
'fumarole',
|
|
|
|
'rock',
|
|
|
|
'saddle',
|
|
|
|
'sinkhole',
|
|
|
|
'stone',
|
|
|
|
'glacier',
|
|
|
|
'spring',
|
|
|
|
'hot_spring',
|
|
|
|
'geyser',
|
|
|
|
],
|
2023-06-09 09:05:07 +00:00
|
|
|
},
|
|
|
|
vanlife: {
|
2023-06-09 10:21:11 +00:00
|
|
|
drinking: ['bar', 'pub', 'cafe', 'drinking_water', 'water_point', 'water'],
|
|
|
|
eating: [
|
|
|
|
'fast_food',
|
|
|
|
'food_court',
|
|
|
|
'pub',
|
|
|
|
'restaurant',
|
|
|
|
'bakery',
|
|
|
|
'butcher',
|
|
|
|
'cheese',
|
|
|
|
'chocolate',
|
|
|
|
'convenience',
|
|
|
|
'dairy',
|
|
|
|
'farm',
|
|
|
|
'greengrocer',
|
|
|
|
'health_food',
|
|
|
|
'pasta',
|
|
|
|
'pastry',
|
|
|
|
'seafood',
|
|
|
|
'supermarket',
|
|
|
|
'wholesale',
|
|
|
|
'outdoor',
|
|
|
|
],
|
|
|
|
money: ['atm', 'bank'],
|
|
|
|
dayToDay: [
|
|
|
|
'atm',
|
|
|
|
'bank',
|
|
|
|
'waste_basket',
|
|
|
|
'waste_disposal',
|
|
|
|
'vending_machine',
|
|
|
|
'department_store',
|
|
|
|
'general',
|
|
|
|
'mall',
|
|
|
|
'laundry',
|
|
|
|
],
|
|
|
|
health: ['doctors', 'hospital', 'pharmacy'],
|
|
|
|
security: ['police', 'fire_station'],
|
|
|
|
parking: ['parking'],
|
|
|
|
sleeping: ['parking', 'camp_site'],
|
|
|
|
naturalSites: [
|
|
|
|
'viewpoint',
|
|
|
|
'waterfall',
|
|
|
|
'peak',
|
|
|
|
'cave_entrance',
|
|
|
|
'volcano',
|
|
|
|
'arch',
|
|
|
|
'arete',
|
|
|
|
'fumarole',
|
|
|
|
'rock',
|
|
|
|
'saddle',
|
|
|
|
'sinkhole',
|
|
|
|
'stone',
|
|
|
|
'glacier',
|
|
|
|
'spring',
|
|
|
|
'hot_spring',
|
|
|
|
'geyser',
|
|
|
|
],
|
2023-06-09 09:05:07 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-06-06 14:03:14 +00:00
|
|
|
export const legacyOverlayDefinitions = {
|
2023-01-24 09:37:03 +00:00
|
|
|
amenity: {
|
2023-05-16 17:29:00 +00:00
|
|
|
bar: {
|
|
|
|
hiking: { drinking: true },
|
|
|
|
cycling: { drinking: true },
|
|
|
|
vanlife: { drinking: true },
|
|
|
|
},
|
2023-05-16 19:46:00 +00:00
|
|
|
fast_food: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
food_court: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
pub: {
|
|
|
|
hiking: { eating: true, drinking: true },
|
|
|
|
cycling: { eating: true, drinking: true },
|
|
|
|
vanlife: { eating: true, drinking: true },
|
|
|
|
},
|
|
|
|
restaurant: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
cafe: {
|
|
|
|
hiking: { drinking: true },
|
|
|
|
cycling: { drinking: true },
|
|
|
|
vanlife: { drinking: true },
|
|
|
|
},
|
|
|
|
atm: {
|
|
|
|
hiking: { money: true, dayToDay: true },
|
|
|
|
cycling: { money: true, dayToDay: true },
|
|
|
|
vanlife: { money: true, dayToDay: true },
|
|
|
|
},
|
|
|
|
bank: {
|
|
|
|
hiking: { money: true, dayToDay: true },
|
|
|
|
cycling: { money: true, dayToDay: true },
|
|
|
|
vanlife: { money: true, dayToDay: true },
|
|
|
|
},
|
|
|
|
doctors: {
|
|
|
|
hiking: { health: true },
|
|
|
|
cycling: { health: true },
|
|
|
|
vanlife: { health: true },
|
|
|
|
},
|
|
|
|
hospital: {
|
|
|
|
hiking: { health: true },
|
|
|
|
cycling: { health: true },
|
|
|
|
vanlife: { health: true },
|
|
|
|
},
|
|
|
|
pharmacy: {
|
|
|
|
hiking: { health: true },
|
|
|
|
cycling: { health: true },
|
|
|
|
vanlife: { health: true },
|
|
|
|
},
|
|
|
|
police: {
|
|
|
|
hiking: { security: true },
|
|
|
|
cycling: { security: true },
|
|
|
|
vanlife: { security: true },
|
|
|
|
},
|
|
|
|
fire_station: {
|
|
|
|
hiking: { security: true },
|
|
|
|
cycling: { security: true },
|
|
|
|
vanlife: { security: true },
|
|
|
|
},
|
|
|
|
drinking_water: {
|
|
|
|
hiking: { drinking: true },
|
|
|
|
cycling: { drinking: true },
|
|
|
|
vanlife: { drinking: true },
|
|
|
|
},
|
|
|
|
water_point: {
|
|
|
|
hiking: { drinking: true },
|
|
|
|
cycling: { drinking: true },
|
|
|
|
vanlife: { drinking: true },
|
|
|
|
},
|
|
|
|
waste_basket: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
waste_disposal: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
vending_machine: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
bicycle_parking: { cycling: { parking: true } },
|
|
|
|
parking: { vanlife: { parking: true, sleeping: true } },
|
2023-01-24 09:37:03 +00:00
|
|
|
},
|
|
|
|
shop: {
|
2023-05-16 19:46:00 +00:00
|
|
|
bakery: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
butcher: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
cheese: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
chocolate: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
convenience: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
dairy: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
farm: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
greengrocer: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
health_food: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
pasta: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
pastry: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
seafood: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
water: {
|
|
|
|
hiking: { drinking: true },
|
|
|
|
cycling: { drinking: true },
|
|
|
|
vanlife: { drinking: true },
|
|
|
|
},
|
|
|
|
department_store: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
general: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
mall: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
|
|
|
supermarket: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
wholesale: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
outdoor: {
|
|
|
|
hiking: { eating: true },
|
|
|
|
cycling: { eating: true },
|
|
|
|
vanlife: { eating: true },
|
|
|
|
},
|
|
|
|
laundry: {
|
|
|
|
hiking: { dayToDay: true },
|
|
|
|
cycling: { dayToDay: true },
|
|
|
|
vanlife: { dayToDay: true },
|
|
|
|
},
|
2023-01-24 09:37:03 +00:00
|
|
|
},
|
|
|
|
tourism: {
|
2023-05-16 19:46:00 +00:00
|
|
|
hotel: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
alpine_hut: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
apartment: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
camp_site: {
|
|
|
|
hiking: { sleeping: true },
|
|
|
|
cycling: { sleeping: true },
|
|
|
|
vanlife: { sleeping: true },
|
|
|
|
},
|
|
|
|
chalet: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
guest_house: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
hostel: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
motel: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
wilderness_hut: { hiking: { sleeping: true }, cycling: { sleeping: true } },
|
|
|
|
viewpoint: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
2023-01-24 09:37:03 +00:00
|
|
|
},
|
2023-06-06 13:15:10 +00:00
|
|
|
waterway: {
|
|
|
|
waterfall: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
},
|
2023-01-24 09:37:03 +00:00
|
|
|
natural: {
|
2023-05-16 19:46:00 +00:00
|
|
|
peak: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
cave_entrance: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
volcano: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
arch: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
arete: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
fumarole: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
rock: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
saddle: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
sinkhole: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
stone: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
glacier: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
spring: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
hot_spring: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
|
|
|
geyser: {
|
|
|
|
hiking: { naturalSites: true },
|
|
|
|
cycling: { naturalSites: true },
|
|
|
|
vanlife: { naturalSites: true },
|
|
|
|
},
|
2023-01-24 09:37:03 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
let _flat: any = [];
|
2023-06-06 14:03:14 +00:00
|
|
|
Object.values(legacyOverlayDefinitions).forEach((category) => {
|
2023-01-24 09:37:03 +00:00
|
|
|
Object.values(category).forEach((subCategory) => {
|
|
|
|
_flat = [..._flat, subCategory];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
type Categories = { string: Set<string> };
|
|
|
|
|
|
|
|
export let overlayCategories: Categories = {};
|
|
|
|
|
|
|
|
_flat.forEach((obj: any) => {
|
|
|
|
Object.keys(obj).forEach((catName: string) => {
|
|
|
|
const catValue = obj[catName];
|
|
|
|
const previous =
|
|
|
|
overlayCategories[catName] === undefined
|
|
|
|
? []
|
|
|
|
: overlayCategories[catName];
|
|
|
|
overlayCategories[catName] = new Set([
|
|
|
|
...previous,
|
|
|
|
...Object.keys(catValue),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2023-01-26 15:48:59 +00:00
|
|
|
export const getVectorTileFeatureType = (feature: Feature) => {
|
2023-01-28 18:05:39 +00:00
|
|
|
if (
|
|
|
|
['hiking'].includes(feature.get('route')) ||
|
|
|
|
['path', 'track', 'footway', 'steps'].includes(feature.get('highway'))
|
|
|
|
) {
|
2023-01-26 15:48:59 +00:00
|
|
|
return 'way';
|
|
|
|
}
|
|
|
|
if (
|
2023-06-06 14:03:14 +00:00
|
|
|
Object.keys(legacyOverlayDefinitions).some((tagName) => {
|
2023-01-26 15:48:59 +00:00
|
|
|
const tagValue = feature.get(tagName);
|
2023-06-06 14:03:14 +00:00
|
|
|
return Object.keys(legacyOverlayDefinitions[tagName]).includes(tagValue);
|
2023-01-26 15:48:59 +00:00
|
|
|
})
|
|
|
|
) {
|
|
|
|
return 'poi';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-01-24 09:37:03 +00:00
|
|
|
console.log({
|
|
|
|
caller: 'overlay-definitions',
|
2023-06-06 14:03:14 +00:00
|
|
|
legacyOverlayDefinitions,
|
2023-01-24 09:37:03 +00:00
|
|
|
_flat,
|
|
|
|
overlayCategories,
|
|
|
|
});
|