Changes between Initial Version and Version 1 of Styles/MapillaryDetections


Ignore:
Timestamp:
2022-07-26T17:37:01+02:00 (3 years ago)
Author:
taylor.smock
Comment:

Start moving Mapillary mapcss files out of the plugin

Legend:

Unmodified
Added
Removed
Modified
  • Styles/MapillaryDetections

    v1 v1  
     1{{{
     2#!style type="mapcss"
     3meta
     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
     27setting::show_accuracy_circles {
     28    type: boolean;
     29    label: tr("Toggle accuracy circles");
     30    default: false;
     31}
     32
     33setting::show_detection_value {
     34    type: boolean;
     35    label: tr("Show detection values for detections with no known specific image");
     36    default: true;
     37}
     38
     39setting::hide_detections_with_no_known_image {
     40    type: boolean;
     41    label: tr("Hide detections with no known image");
     42    default: true;
     43}
     44
     45node|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}
     52node|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}
     59node|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}
     66node[layer=traffic_sign][value!~/^(object--traffic-(sign|light)--(|direction-|general-upright-|pedestrians-)(front|back|side))$/] {
     67    imagepath: "package_signs";
     68}
     69node[layer=point] {
     70    imagepath: "package_objects";
     71}
     72
     73/* Avoid trying to show images for detections when the image does not exist */
     74node[value=general--traffic-sign--g1],
     75node[value=complementary--texts-three-lines--g1],
     76node[value=complementary--texts-two-lines--g1],
     77node[value=information--general-directions--g1],
     78node[value=marking--discrete--symbol--wheelchair],
     79node[value=marking--discrete--text--other],
     80node[value=marking--discrete--text--stop],
     81node[value=object--sign--back],
     82node[value=object--sign--other],
     83node[value=object--traffic-light--cyclists-front],
     84node[value=object--traffic-light--general-horizontal-back],
     85node[value=object--traffic-light--general-horizontal-front],
     86node[value=object--traffic-light--general-single-front],
     87node[value=object--traffic-light--general-upright-back],
     88node[value=object--traffic-light--general-upright-front],
     89node[value=object--traffic-light--general-upright-side],
     90node[value=object--traffic-light--pedestrians-back],
     91node[value=object--traffic-light--pedestrians-front],
     92node[value=object--traffic-light--pedestrians-side],
     93node[value=object--traffic-sign--back],
     94node[value=object--traffic-sign--back],
     95node[value=object--traffic-sign--direction-back],
     96node[value=object--traffic-sign--direction-front],
     97node[value=object--traffic-sign--front],
     98node[value=object--traffic-sign--information-parking],
     99node[value=object--traffic-sign--temporary-back],
     100node[value=object--traffic-sign--temporary-front],
     101node[value=regulatory--texts-four-lines--g1],
     102node[value=regulatory--texts-one-line--g1],
     103node[value=regulatory--texts-three-lines--g1],
     104node[value=regulatory--texts-two-lines--g1]
     105{
     106    noimage: true;
     107}
     108
     109node|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
     113node|z18-[value][is_prop_set(noimage)] {
     114    symbol-shape: square;
     115    symbol-fill-color: white;
     116    symbol-size: 16;
     117}
     118
     119node|z20-[value][is_prop_set(noimage)][setting("show_detection_value")],
     120node|z24-[value][setting("show_detection_value")] {
     121    text: value;
     122}
     123
     124node[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}}}