| | 1 | {{{ |
| | 2 | #!style type="mapcss" |
| | 3 | meta |
| | 4 | { |
| | 5 | title: "Mapillary Object Detections"; |
| | 6 | description: "Paint style for Mapillary point objects"; |
| | 7 | author: "Taylor Smock"; |
| | 8 | version: "1.[[revision]]_[[date]]"; |
| | 9 | icon: "mapillary-logo.svg"; |
| | 10 | } |
| | 11 | /*----------------------------------------------------------------------------*/ |
| | 12 | /* Pixel per metre (on average) */ |
| | 13 | /* Copied from Lane_and_Road_Attributes */ |
| | 14 | /*----------------------------------------------------------------------------*/ |
| | 15 | *|z16 { pixel_per_metre: 0.625; } |
| | 16 | *|z17 { pixel_per_metre: 1.25; } |
| | 17 | *|z18 { pixel_per_metre: 2.5; } |
| | 18 | *|z19 { pixel_per_metre: 5; } |
| | 19 | *|z20 { pixel_per_metre: 10; } |
| | 20 | *|z21 { pixel_per_metre: 20; } |
| | 21 | *|z22 { pixel_per_metre: 40; } |
| | 22 | *|z23 { pixel_per_metre: 80; } |
| | 23 | *|z24 { pixel_per_metre: 160; } |
| | 24 | *|z25 { pixel_per_metre: 320; } |
| | 25 | *|z26- { pixel_per_metre: 640; } |
| | 26 | |
| | 27 | setting::show_accuracy_circles { |
| | 28 | type: boolean; |
| | 29 | label: tr("Toggle accuracy circles"); |
| | 30 | default: false; |
| | 31 | } |
| | 32 | |
| | 33 | setting::show_detection_value { |
| | 34 | type: boolean; |
| | 35 | label: tr("Show detection values for detections with no known specific image"); |
| | 36 | default: true; |
| | 37 | } |
| | 38 | |
| | 39 | setting::hide_detections_with_no_known_image { |
| | 40 | type: boolean; |
| | 41 | label: tr("Hide detections with no known image"); |
| | 42 | default: true; |
| | 43 | } |
| | 44 | |
| | 45 | node|z20-[setting("show_accuracy_circles")][accuracy > 10]::mapillary_object_layer { |
| | 46 | symbol-shape: circle; |
| | 47 | symbol-size: 2 * tag("accuracy") * prop(pixel_per_metre, "default" ); |
| | 48 | symbol-fill-opacity: 0.2; |
| | 49 | symbol-fill-color: orange; |
| | 50 | symbol-stroke-color: orange; |
| | 51 | } |
| | 52 | node|z20-[setting("show_accuracy_circles")][accuracy <= 10][accuracy > 5]::mapillary_object_layer { |
| | 53 | symbol-shape: circle; |
| | 54 | symbol-size: 2 * tag("accuracy") * prop(pixel_per_metre, "default" ); |
| | 55 | symbol-fill-opacity: 0.2; |
| | 56 | symbol-fill-color: yellow; |
| | 57 | symbol-stroke-color: yellow; |
| | 58 | } |
| | 59 | node|z20-[setting("show_accuracy_circles")][accuracy <= 5]::mapillary_object_layer { |
| | 60 | symbol-shape: circle; |
| | 61 | symbol-size: 2 * tag("accuracy") * prop(pixel_per_metre, "default" ); |
| | 62 | symbol-fill-opacity: 0.2; |
| | 63 | symbol-fill-color: green; |
| | 64 | symbol-stroke-color: green; |
| | 65 | } |
| | 66 | node[layer=traffic_sign][value!~/^(object--traffic-(sign|light)--(|direction-|general-upright-|pedestrians-)(front|back|side))$/] { |
| | 67 | imagepath: "package_signs"; |
| | 68 | } |
| | 69 | node[layer=point] { |
| | 70 | imagepath: "package_objects"; |
| | 71 | } |
| | 72 | |
| | 73 | /* Avoid trying to show images for detections when the image does not exist */ |
| | 74 | node[value=general--traffic-sign--g1], |
| | 75 | node[value=complementary--texts-three-lines--g1], |
| | 76 | node[value=complementary--texts-two-lines--g1], |
| | 77 | node[value=information--general-directions--g1], |
| | 78 | node[value=marking--discrete--symbol--wheelchair], |
| | 79 | node[value=marking--discrete--text--other], |
| | 80 | node[value=marking--discrete--text--stop], |
| | 81 | node[value=object--sign--back], |
| | 82 | node[value=object--sign--other], |
| | 83 | node[value=object--traffic-light--cyclists-front], |
| | 84 | node[value=object--traffic-light--general-horizontal-back], |
| | 85 | node[value=object--traffic-light--general-horizontal-front], |
| | 86 | node[value=object--traffic-light--general-single-front], |
| | 87 | node[value=object--traffic-light--general-upright-back], |
| | 88 | node[value=object--traffic-light--general-upright-front], |
| | 89 | node[value=object--traffic-light--general-upright-side], |
| | 90 | node[value=object--traffic-light--pedestrians-back], |
| | 91 | node[value=object--traffic-light--pedestrians-front], |
| | 92 | node[value=object--traffic-light--pedestrians-side], |
| | 93 | node[value=object--traffic-sign--back], |
| | 94 | node[value=object--traffic-sign--back], |
| | 95 | node[value=object--traffic-sign--direction-back], |
| | 96 | node[value=object--traffic-sign--direction-front], |
| | 97 | node[value=object--traffic-sign--front], |
| | 98 | node[value=object--traffic-sign--information-parking], |
| | 99 | node[value=object--traffic-sign--temporary-back], |
| | 100 | node[value=object--traffic-sign--temporary-front], |
| | 101 | node[value=regulatory--texts-four-lines--g1], |
| | 102 | node[value=regulatory--texts-one-line--g1], |
| | 103 | node[value=regulatory--texts-three-lines--g1], |
| | 104 | node[value=regulatory--texts-two-lines--g1] |
| | 105 | { |
| | 106 | noimage: true; |
| | 107 | } |
| | 108 | |
| | 109 | node|z18-[value][is_prop_set(imagepath)][!is_prop_set(noimage)] { |
| | 110 | icon-image: concat("https://raw.githubusercontent.com/mapillary/mapillary_sprite_source/master/", prop(imagepath), "/", tag("value"), ".svg"); |
| | 111 | } |
| | 112 | |
| | 113 | node|z18-[value][is_prop_set(noimage)] { |
| | 114 | symbol-shape: square; |
| | 115 | symbol-fill-color: white; |
| | 116 | symbol-size: 16; |
| | 117 | } |
| | 118 | |
| | 119 | node|z20-[value][is_prop_set(noimage)][setting("show_detection_value")], |
| | 120 | node|z24-[value][setting("show_detection_value")] { |
| | 121 | text: value; |
| | 122 | } |
| | 123 | |
| | 124 | node[layer=~/trafficsigns|points/]:selected::selected_layer { |
| | 125 | symbol-shape: square; |
| | 126 | symbol-size: +4; |
| | 127 | symbol-stroke-color: red; |
| | 128 | symbol-stroke-opacity: 0.7; |
| | 129 | } |
| | 130 | }}} |