
meta {
    title: "Disc Golf Course Testing";
    version: "0.8_2024-03-21";
    description: "Colouring and icons for a Disc Golf Course to make mapping it easier.";
    icon:"DiscGolfCourse.svg";
    author: "Negreheb";
    link: "https://josm.openstreetmap.de/wiki/Styles/DiscGolfCourse";
}

meta[lang=de] {
    title: "Disc Golf Course";
    description: "Einfärbungen und Symbole für einen Disc-Golf-Kurs, um das Mappen zu erleichtern.";
    link: "https://josm.openstreetmap.de/wiki/De:Styles/DiscGolfCourse";
}

/* ------------------------------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------------------------------ */

/**********************************************/
/*              Create mappaint user settings */
/**********************************************/

setting::using_golf {
    type: boolean;
    label: tr("Check if golf=* is used at all");
    default: true;
}

/**********************************************/
/*                            General setting */
/**********************************************/

node[disc_golf=tee]{
    icon-image: "tee.svg";
    icon-width: 75;
    icon-offset-x: 10;
    symbol-stroke-color: #FFC800;
    text: auto;
}

node[disc_golf=basket]{
    icon-image: "basket2.svg";
    icon-width: 50;
    icon-offset-y: -28;
    icon-offset-x: 1;
    text: auto;
}

way[disc_golf=hole]{
    text: "ref";
    font-size: 20;
    width: 25;
    opacity: 0.2;
    left-casing-color: black;
    left-casing-width: 2;
    left-casing-dashes: 0;
    left-casing-opacity: 0.7;
    right-casing-color: black;
    right-casing-width: 2;
    right-casing-opacity: 0.7;
    right-casing-dashes: 0;
}

node[disc_golf=drop_zone]{
    text: eval("DZ");
    text-color: orange;
    font-size: 10;
    casing-width: 10;
    symbol-size: 20;
    symbol-shape: circle;
    symbol-fill-color: orange;
    symbol-fill-opacity: 0.5;
}

/* If mando is tagged to an existing node like natural=tree, it will not get rendered */
/* But the text will appear next to it */
*[disc_golf=mando]{
    color: red;
	width: 5;
	opacity: 0.8;
	text: eval("Mando");
    text-color: red;
    font-weight: bold;
    font-size: 15;
    symbol-size: 20;
    symbol-shape: triangle;
    symbol-fill-color: red;
    symbol-fill-opacity: 0.5;
}

/* If mando is a way, offset the text */
way[disc_golf=mando]{
	text-offset-y: 10;
}

area[disc_golf=out_of_bounds]{
    fill-color: red;
    text: eval("OB");
    text-color: red;
    font-weight: bold;
    font-size: 15;
}

/**********************************************/
/*                            Common pitfalls */
/**********************************************/

/* ************** disc_golf=pin instead of basket */
node[disc_golf=pin]{
    text: eval("Use basket");
    text-color: purple;
    font-size: 20;
    font-weight: bold;
    color: purple;
    width: 30;
    opacity: 1;
    dashes: 0;
    symbol-size: 40;
    symbol-shape: circle;
    symbol-fill-color: purple;
}

/* ************** Catch a name on an hole */
way[disc_golf=hole][name]{
    text: eval("NO NAME ON HOLE");
    text-color: purple;
    font-size: 20;
    font-weight: bold;
    text-offset-y: 30;
}

/* ************** Catch everything tagged with golf=* */
*[golf][setting("using_golf")]{
    color: purple;
    width: 30;
    opacity: 1;
    dashes: 0;
    symbol-size: 40;
    symbol-shape: circle;
    symbol-fill-color: purple;
}

