Skip to content

Commit

Permalink
_search() should not pass long values <-180 or >180
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenenglish committed Jan 6, 2015
1 parent 6d60d73 commit bb62590
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@
function _search() {
var params = filterParams(['view', 'spatial_search_type', 'coordinates', 'f%5B' + options.placenamefield + '%5D%5B%5D']),
bounds = map.getBounds().toBBoxString().split(',').map(function(coord) {
if (parseFloat(coord) > 180) {
coord = '180'
} else if (parseFloat(coord) < -180) {
coord = '-180'
}
return Math.round(parseFloat(coord) * 1000000) / 1000000;
}),
coordinate_params = '[' + bounds[1] + ',' + bounds[0] + ' TO ' + bounds[3] + ',' + bounds[2] + ']';
Expand Down

0 comments on commit bb62590

Please sign in to comment.