Browse Source

place: Use 'obj.tags.name' from Overpass if avail.

Use obj.name as fallback
master
Chimo 6 years ago
parent
commit
f68b924193
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/Place.js

+ 6
- 1
src/Place.js View File

@ -6,12 +6,17 @@
_Place = function( obj ) {
/* Copy Overpass info */
this.osm_id = obj.id;
this.name = obj.name;
this.tags = obj.tags;
this.lat = obj.lat;
this.lon = obj.lon;
this.osm_type = obj.type;
if ( obj.tags && obj.tags.name ) {
this.name = obj.tags.name;
} else {
this.name = obj.name || "";
}
// Add ID required by nominatim
this.fid = obj.type.slice( 0, 1 ).toUpperCase() + obj.id;
};


Loading…
Cancel
Save