Skip to content

Commit

Permalink
Phonon: all properties in display name
Browse files Browse the repository at this point in the history
  • Loading branch information
LiaanM authored and simon04 committed Aug 23, 2018
1 parent 01fb282 commit d3706f7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/geocoders/photon.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
}

results.push({
name: this._deocodeFeatureName(f),
name: this._decodeFeatureName(f),
html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,
center: latLng,
bbox: bbox,
Expand All @@ -87,13 +87,15 @@ export default {
return results;
},

_deocodeFeatureName: function(f) {
var j, name;
for (j = 0; !name && j < this.options.nameProperties.length; j++) {
name = f.properties[this.options.nameProperties[j]];
}

return name;
_decodeFeatureName: function(f) {
return (this.options.nameProperties || [])
.map(function(p) {
return f.properties[p];
})
.filter(function(v) {
return !!v;
})
.join(', ');
}
}),

Expand Down

0 comments on commit d3706f7

Please sign in to comment.