Changeset 2750 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-01-07T09:21:49+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r2711 r2750 47 47 48 48 /** the default list of tags which are used as naming tags in relations */ 49 static public final String[] DEFAULT_NAMING_TAGS_FOR_RELATIONS = {"name", "ref", "restriction", "note"}; 49 static public final String[] DEFAULT_NAMING_TAGS_FOR_RELATIONS = {"name", "ref", "restriction", "public_transport", ":LocationCode", "note"}; 50 50 51 51 /** the current list of tags used as naming tags in relations */ … … 161 161 name = relation.get("type"); 162 162 if (name == null) { 163 name = (relation.get("public_transport") != null) ? tr("public transport") : ""; 164 } 165 if (name == null) { 163 166 name = tr("relation"); 164 167 } … … 166 169 name += " ("; 167 170 String nameTag = null; 168 Set<String> namingTags = new HashSet<String>(getNamingtagsForRelations()); 169 for (String n : relation.keySet()) { 170 // #3328: "note " and " note" are name tags too 171 if (namingTags.contains(n.trim())) { 171 for (String n : getNamingtagsForRelations()) { 172 if (n.equals("name")) { 172 173 if (Main.pref.getBoolean("osm-primitives.localize-name", true)) { 173 174 nameTag = relation.getLocalName(); … … 175 176 nameTag = relation.getName(); 176 177 } 177 if (nameTag == null) { 178 nameTag = relation.get(n); 178 } else if (n.equals(":LocationCode")) { 179 for (String m : relation.keySet()) { 180 if (m.endsWith(n)) { 181 nameTag = relation.get(m); 182 break; 183 } 179 184 } 185 } else { 186 nameTag = relation.get(n); 180 187 } 181 188 if (nameTag != null) {
Note:
See TracChangeset
for help on using the changeset viewer.