Changeset 4744 in josm


Ignore:
Timestamp:
2011-12-29T16:16:17+01:00 (12 years ago)
Author:
Don-vip
Message:

Building presets

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/defaultpresets.xml

    r4708 r4744  
    38073807    <group name="Man Made" icon="presets/works.png">
    38083808        <item name="Building" icon="styles/standard/misc/landmark/building.png" type="node,closedway,relation">
    3809             <key key="building" value="yes" />
     3809            <link href="http://wiki.openstreetmap.org/wiki/Key:building"
     3810                  de.href="http://wiki.openstreetmap.org/wiki/DE:Key:building"
     3811                  fr.href="http://wiki.openstreetmap.org/wiki/FR:Key:building"
     3812                  it.href="http://wiki.openstreetmap.org/wiki/IT:Key:building"
     3813                  ja.href="http://wiki.openstreetmap.org/wiki/JA:Key:building"
     3814                  nl.href="http://wiki.openstreetmap.org/wiki/NL:Key:building"
     3815                  no.href="http://wiki.openstreetmap.org/wiki/NO:Key:building"
     3816                  pl.href="http://wiki.openstreetmap.org/wiki/PL:Key:building"
     3817                  ru.href="http://wiki.openstreetmap.org/wiki/RU:Key:building" />
     3818            <label text="Edit Building" />
     3819            <combo key="building" text="Building" values="yes,roof,garage,industrial,church,school,hangar,commercial,farm,transportation,greenhouse,office,university" default="yes" />
     3820            <text key="name" text="Name" default="" delete_if_empty="true" />
     3821        </item>
     3822        <item name="Residential Building" icon="styles/standard/misc/landmark/building.png" type="node,closedway,relation">
     3823            <link href="http://wiki.openstreetmap.org/wiki/Key:building"
     3824                  de.href="http://wiki.openstreetmap.org/wiki/DE:Key:building"
     3825                  fr.href="http://wiki.openstreetmap.org/wiki/FR:Key:building"
     3826                  it.href="http://wiki.openstreetmap.org/wiki/IT:Key:building"
     3827                  ja.href="http://wiki.openstreetmap.org/wiki/JA:Key:building"
     3828                  nl.href="http://wiki.openstreetmap.org/wiki/NL:Key:building"
     3829                  no.href="http://wiki.openstreetmap.org/wiki/NO:Key:building"
     3830                  pl.href="http://wiki.openstreetmap.org/wiki/PL:Key:building"
     3831                  ru.href="http://wiki.openstreetmap.org/wiki/RU:Key:building" />
     3832            <label text="Edit Residential Building" />
     3833            <combo key="building" text="Building" values="residential,apartments,house,hut,terraced,detached,roof" default="residential" />
     3834            <text key="name" text="Name" default="" delete_if_empty="true" />
    38103835        </item>
    38113836        <item name="Tower" icon="presets/tower.png" type="node,closedway">
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r4477 r4744  
    8484    /** the default list of tags which are used as naming tags in relations */
    8585    static public final String[] DEFAULT_NAMING_TAGS_FOR_RELATIONS = {"name", "ref", "restriction", "landuse", "natural",
    86         "public_transport", ":LocationCode", "note"};
     86        "public_transport", ":LocationCode", "note", "building"};
    8787
    8888    /** the current list of tags used as naming tags in relations */
     
    226226                                (way.get("railway") != null) ? tr("railway") :
    227227                                    (way.get("waterway") != null) ? tr("waterway") :
    228                                         (way.get("landuse") != null) ? tr("landuse") : null;
     228                                        (way.get("building") != null) ? tr("building") :
     229                                            (way.get("landuse") != null) ? tr("landuse") : null;
    229230                }
    230231                if(n == null)
     
    433434        if (name == null) {
    434435            String building  = relation.get("building");
    435             if(OsmUtils.isTrue(building)) {
     436            if (OsmUtils.isTrue(building)) {
    436437                name = tr("building");
    437438            } else if(building != null)
     
    472473            }
    473474            return null;
    474         } else
     475        } else if (OsmUtils.isTrue(relation.get(nameTag))) {
     476            return tr(nameTag);
     477        } else if (OsmUtils.isFalse(relation.get(nameTag))) {
     478            return null;
     479        } else {
    475480            return trc_lazy(nameTag, I18n.escape(relation.get(nameTag)));
     481        }
    476482    }
    477483
Note: See TracChangeset for help on using the changeset viewer.