wiki:Styles/Direction

Languages:

Direction

Description

The mappaint style "Direction" displays the following direction key: direction, light:direction and camera:direction.

For ideas/questions/bugs/suggestions or similar please write a message to Hanikatu.

Feel free to translate this wiki page into more languages. Already translated languages see top right.

Examples (NOZIP)

Note:

Can only display one floodlight per node.

Code

meta {
    title: "Direction";   /* title shown in the menu */
    icon: "Ausrichtung.svg"; /* small icon shown in the menu next to the title */
    version: "1.1.6_2021-06-06";
    description: "Shows the direction of object or light.";      
    author: "Hanikatu";
    link: "https://josm.openstreetmap.de/wiki/Styles/Direction";
}

meta[lang=de] {
    title: "Ausrichtung";
    description: "Zeigt die Ausrichtung vom Objekt oder Licht an.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/Direction";
}

/*
   zoomlevels: 
   icons 21+ great
   below 20 smaller icons

   ways: -19 narrow
   20+ dick

   texts 16-20 short
   20- normal
*/


/* --------------------- Fehler anzeigen ------------------------ */

node|z17-[direction][highway !~ /^(give_way|stop)/]::randg
{
  /* alles was 'direction' enthält (außer give_way und stop) als Fehler markieren */
  /* doto: herausfinden, wie man individuelle Kreise erzeugt */
  
  symbol-shape: square;
  symbol-fill-color:orange;
  symbol-size:30;
  z-index:-1;
}


/* --------------------- Richtung anzeigen ------------------------ */

node|z17-[direction =~ /[0-9]/][direction !~ /[-]/]::randg{
  /* nur ganze Grad-Zahlen - Fehler wird aufgehoben */
  
  icon-image: "Ausrichtung.svg";
  z-index:-100;
  icon-width:20;  
  
  icon-rotation: degree_to_radians( tag("direction") );
}

node|z17-[direction =~ /[nsweNSWE]/][direction !~ /[^nsweNSWE]/]::randg{
  /* nur ganze Himmelsrichtungen - Fehler wird aufgehoben */
  
  icon-image: "Ausrichtung.svg";
  z-index:-100;
  icon-width:20;  
  
  icon-rotation: cardinal_to_radians( tag("direction") );
}


/* --------------------- Flutlicht anzeigen ------------------------ */

node|z17-[light:direction =~ /[0-9]/][light:direction !~ /[-]/]::randg{
  /* nur ganze Grad-Zahlen - Fehler wird aufgehoben */
  
  icon-image: "Flutlicht.svg";
  z-index:-100;
  icon-width:50;  
  
  icon-rotation: degree_to_radians( tag("light:direction") );
}

node|z17-[light:direction =~ /[nsweNSWE]/][light:direction !~ /[^nsweNSWE]/]::randg{
  /* nur ganze Himmelsrichtungen - Fehler wird aufgehoben */
  
  icon-image: "Flutlicht.svg";
  z-index:-100;
  icon-width:50;  
  
  icon-rotation: cardinal_to_radians( tag("light:direction") );
}



/* --------------------- Kamerarichtung anzeigen ------------------------ */

node|z17-[camera:direction =~ /[0-9]/][camera:direction !~ /[-]/]::randg{
  /* nur ganze Grad-Zahlen - Fehler wird aufgehoben */
  
  icon-image: "Ausrichtung.svg";
  z-index:-100;
  icon-width:20;  
  
  icon-rotation: degree_to_radians( tag("camera:direction") );
}

node|z17-[camera:direction =~ /[nsweNSWE]/][camera:direction !~ /[^nsweNSWE]/]::randg{
  /* nur ganze Himmelsrichtungen - Fehler wird aufgehoben */
  
  icon-image: "Ausrichtung.svg";
  z-index:-100;
  icon-width:20;  
  
  icon-rotation: cardinal_to_radians( tag("camera:direction") );
}

Styles_Direction-style.mapcss, Styles_Direction.zip

Last modified 3 years ago Last modified on 2021-06-06T14:04:14+02:00

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.