Merge pull request #249 from shramov/operator-name

MapObject: set name from operator
This commit is contained in:
Pavol Zibrita 2012-05-12 22:18:59 -07:00
commit 5b3424c69e

View file

@ -43,6 +43,17 @@ public abstract class MapObject implements Comparable<MapObject>, Serializable {
if(this.location == null){
this.location = MapUtils.getCenter(e);
}
this.setNameFromOperator(e);
}
public void setNameFromOperator(Entity e){
if (this.name != null) return;
String op = e.getTag(OSMTagKey.OPERATOR);
String ref = e.getTag(OSMTagKey.REF);
if (op == null) return;
if (ref != null)
op += " [" + ref + "]";
this.name = op;
}
public EntityId getEntityId(){