2020-11-17 02:22:48 +01:00
{
"id" : "direction" ,
"name" : {
2021-04-23 13:56:16 +02:00
"en" : "Direction visualization" ,
"nl" : "Richtingsvisualisatie"
2020-11-17 02:22:48 +01:00
} ,
"minzoom" : 16 ,
2021-03-20 23:45:52 +01:00
"source" : {
"osmTags" : {
"or" : [
"camera:direction~*" ,
"direction~*"
]
}
2020-11-17 02:22:48 +01:00
} ,
"doNotDownload" : true ,
"passAllFeatures" : true ,
"title" : null ,
"description" : {
2021-04-23 13:56:16 +02:00
"en" : "This layer visualizes directions" ,
"nl" : "Deze laag toont de oriëntatie van een object"
2020-11-17 02:22:48 +01:00
} ,
"tagRenderings" : [ ] ,
2021-01-04 04:06:21 +01:00
"icon" : {
"render" : "direction_gradient:var(--catch-detail-color)" ,
"#" : "For some weird reason, showing the icon in the layer control panel breaks the svg-gradient (because the svg gradient has a global color or smthng) - so we use a different icon without gradient" ,
"mappings" : [
{
"if" : "id=node/-1" ,
"then" : "direction:var(--catch-detail-color)"
}
]
} ,
2020-11-17 02:22:48 +01:00
"rotation" : {
Fix issues with camera rotation
This commit fixes at least these issues that I was aware of:
* Cardinal directions (e.g. NE) were not recognized.
* The camera icon did not rotatie when direction=* was used instead of
camera:direction, but the blue direction visualizer did.
Pietervdvn said he would have liked to convert the code for direction
normalizing to calculatedTags in a JSON file (as documented in
Docs/CalculatedTags.md), but when he saw the oneliners I had to produce
in response, I was allowed to keep it in SimpleMetaTagger.ts for now.
For your amusement, the oneliners are included below.
"calculatedTags": [
"_direction:numerical=(dir => dir === undefined ? undefined : ({N: 0, NNE: 22.5, NE: 45, ENE: 67.5, E: 90, ESE: 112.5, SE: 135, SSE: 157.5, S: 180, SSW: 202.5, SW: 225, WSW: 247.5, W: 270, WNW: 292.5, NW: 315, NNW: 337.5}[dir] ?? (isNaN(parseFloat(dir)) ? undefined : ((parseFloat(dir) % 360 + 360) % 360)))))(feat.properties['camera:direction'] ?? feat.properties.direction)",
"_direction:leftright=feat.properties['_direction:numerical'] === undefined ? undefined : (feat.properties['_direction:numerical'] <= 180 ? 'right' : 'left')"
]
2021-04-28 16:45:48 +02:00
"render" : "{_direction:numerical}deg"
2020-11-17 02:22:48 +01:00
} ,
2021-01-04 04:06:21 +01:00
"iconSize" : "200,200,center" ,
2020-11-17 02:22:48 +01:00
"color" : "--catch-detail-color" ,
"stroke" : "0" ,
"presets" : [ ] ,
"wayHandling" : 2
Fix issues with camera rotation
This commit fixes at least these issues that I was aware of:
* Cardinal directions (e.g. NE) were not recognized.
* The camera icon did not rotatie when direction=* was used instead of
camera:direction, but the blue direction visualizer did.
Pietervdvn said he would have liked to convert the code for direction
normalizing to calculatedTags in a JSON file (as documented in
Docs/CalculatedTags.md), but when he saw the oneliners I had to produce
in response, I was allowed to keep it in SimpleMetaTagger.ts for now.
For your amusement, the oneliners are included below.
"calculatedTags": [
"_direction:numerical=(dir => dir === undefined ? undefined : ({N: 0, NNE: 22.5, NE: 45, ENE: 67.5, E: 90, ESE: 112.5, SE: 135, SSE: 157.5, S: 180, SSW: 202.5, SW: 225, WSW: 247.5, W: 270, WNW: 292.5, NW: 315, NNW: 337.5}[dir] ?? (isNaN(parseFloat(dir)) ? undefined : ((parseFloat(dir) % 360 + 360) % 360)))))(feat.properties['camera:direction'] ?? feat.properties.direction)",
"_direction:leftright=feat.properties['_direction:numerical'] === undefined ? undefined : (feat.properties['_direction:numerical'] <= 180 ? 'right' : 'left')"
]
2021-04-28 16:45:48 +02:00
}