Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented May 31, 2018

update buildQueryString() to accept array values. This allows for passing an array of osm_tag values and having them all passed to the photon server correctly.

calling encodeURIComponent on osm_tag(s) breaks place:city

intergalacticdata added 3 commits May 30, 2018 19:21
verifies that non-strings have a length > 0. removes string encoding - osm_tag place:value combos are currently broken due to encoding the colon.
@yohanboniface
Copy link
Contributor

Thanks for this work!
The array support seems legit, but I've some comments.

calling encodeURIComponent on osm_tag(s) breaks place:city

: is not valid as query string key, afaik: https://tools.ietf.org/html/rfc3986#section-2.2

},

_onSelected: function (feature) {
this.map.setView([feature.geometry.coordinates[1], feature.geometry.coordinates[0]], 16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated to the current topic.

if (params[key]) {
queryString.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
if (params[key] && (typeof(params[key]) == 'string' || typeof(params[key]) == 'number')) {
queryString.push(encodeURIComponent(key) + '=' + params[key]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be factorized with the line 38.
Basically I think the pattern is to always process an array, and turn the param in an array when it's not.

@ghost
Copy link
Author

ghost commented Jun 6, 2018 via email

@ghost
Copy link
Author

ghost commented Jun 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant