From b0b71a54383de2c6e3ae2b9a3ab12b304983d71f Mon Sep 17 00:00:00 2001 From: fxia Date: Fri, 24 Jul 2015 11:41:11 -0400 Subject: [PATCH] [#112] bbox fix only kicks in with positive w-long and negative e-long --- ckanext/spatial/public/js/dataset_map.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckanext/spatial/public/js/dataset_map.js b/ckanext/spatial/public/js/dataset_map.js index 59164e2..0d0702c 100644 --- a/ckanext/spatial/public/js/dataset_map.js +++ b/ckanext/spatial/public/js/dataset_map.js @@ -26,12 +26,13 @@ this.ckan.module('dataset-map', function (jQuery, _) { this.extent = this.el.data('extent'); // fix bbox when w-long is positive while e-long is negative. + // assuming coordinate sequence is west to east (left to right) if (this.extent.type == 'Polygon' && this.extent.coordinates[0].length == 5) { _coordinates = this.extent.coordinates[0] w = _coordinates[0][0]; e = _coordinates[2][0]; - if (w > e) { + if (w >= 0 && e < 0) { w_new = w while (w_new > e) w_new -=360 for (var i = 0; i < _coordinates.length; i++) {