Custom Search Provider example not working for special characters
Dear,
I was looking into the Custom Search Provider example (Geocortex Viewer for HTML5 (vertigisstudio.com), but the implementation is not working (no search results) for search parameters that contain special characters like ü or è. Example search strings: "München" or "Liège".
The problem is not related to the used search webservice because http://api.geonames.org/wikipediaSearch?q=münchen&username=latitudegeo&type=json
has results in a browser. Also when ü is encoded (browser automatically changes this back to ü): http://api.geonames.org/wikipediaSearch?q=m%C3%BCnchen&username=latitudegeo&type=json
But in the HTML5 viewer application, where the request is sent using the proxy page, https://docs.vertigisstudio.com/essentials/gvh/latest/SamplesViewer/proxy.ashx?http://api.geonames.org/wikipediaSearch?q=m%C3%BCnchen&username=latitudegeo&type=json this is not functioning.
In the code example (GeoNamesSearchProvider.ts), I can see that the search text is encoded, I assume for some good reason?
// Populate the query URL with parameters.
const queryUrl = this.geoNamesUrl + this.geoNamesQueryTemplate.format(encodeURIComponent(searchText), this.geoNamesUser);
What should be the solution to be able to use search texts with special characters like ü or è?
Kind regards,
Please sign in to leave a comment.
Comments
0 comments