Skip to content

Commit

Permalink
nominatim: drop jsonp in favour of standard XHR
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Jan 8, 2018
1 parent dea9874 commit b693edd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/geocoders/nominatim.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ export default {
},

geocode: function(query, cb, context) {
Util.jsonp(this.options.serviceUrl + 'search', L.extend({
Util.getJSON(this.options.serviceUrl + 'search', L.extend({
q: query,
limit: 5,
format: 'json',
addressdetails: 1
}, this.options.geocodingQueryParams),
function(data) {
L.bind(function(data) {
var results = [];
for (var i = data.length - 1; i >= 0; i--) {
var bbox = data[i].boundingbox;
Expand All @@ -56,17 +56,17 @@ export default {
};
}
cb.call(context, results);
}, this, 'json_callback');
}, this));
},

reverse: function(location, scale, cb, context) {
Util.jsonp(this.options.serviceUrl + 'reverse', L.extend({
Util.getJSON(this.options.serviceUrl + 'reverse', L.extend({
lat: location.lat,
lon: location.lng,
zoom: Math.round(Math.log(scale / 256) / Math.log(2)),
addressdetails: 1,
format: 'json'
}, this.options.reverseQueryParams), function(data) {
}, this.options.reverseQueryParams), L.bind(function(data) {
var result = [],
loc;

Expand All @@ -84,7 +84,7 @@ export default {
}

cb.call(context, result);
}, this, 'json_callback');
}, this));
}
}),

Expand Down

0 comments on commit b693edd

Please sign in to comment.