Skip to content

Commit d3706f7

Browse files
LiaanMsimon04
authored andcommitted
Phonon: all properties in display name
1 parent 01fb282 commit d3706f7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/geocoders/photon.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default {
7575
}
7676

7777
results.push({
78-
name: this._deocodeFeatureName(f),
78+
name: this._decodeFeatureName(f),
7979
html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,
8080
center: latLng,
8181
bbox: bbox,
@@ -87,13 +87,15 @@ export default {
8787
return results;
8888
},
8989

90-
_deocodeFeatureName: function(f) {
91-
var j, name;
92-
for (j = 0; !name && j < this.options.nameProperties.length; j++) {
93-
name = f.properties[this.options.nameProperties[j]];
94-
}
95-
96-
return name;
90+
_decodeFeatureName: function(f) {
91+
return (this.options.nameProperties || [])
92+
.map(function(p) {
93+
return f.properties[p];
94+
})
95+
.filter(function(v) {
96+
return !!v;
97+
})
98+
.join(', ');
9799
}
98100
}),
99101

0 commit comments

Comments
 (0)