bbox fix. make sure w long value is less than e long value
This commit is contained in:
parent
67acd0b6bb
commit
cc0d0b14ce
|
@ -25,6 +25,19 @@ this.ckan.module('dataset-map', function (jQuery, _) {
|
||||||
|
|
||||||
this.extent = this.el.data('extent');
|
this.extent = this.el.data('extent');
|
||||||
|
|
||||||
|
// fix bbox when w-long is positive while e-long is negative.
|
||||||
|
if (this.extent.type == 'Polygon'
|
||||||
|
&& this.extent.coordinates[0].length == 5) {
|
||||||
|
_coordinates = this.extent.coordinates
|
||||||
|
s = _coordinates[0][0][1];
|
||||||
|
w = _coordinates[0][0][0];
|
||||||
|
n = _coordinates[0][2][1];
|
||||||
|
e = _coordinates[0][1][0];
|
||||||
|
while (w > e) w -=360
|
||||||
|
|
||||||
|
this.extent.coordinates = [[[w,s],[e,s],[e,n],[w,n],[w,s]]]
|
||||||
|
};
|
||||||
|
|
||||||
// hack to make leaflet use a particular location to look for images
|
// hack to make leaflet use a particular location to look for images
|
||||||
L.Icon.Default.imagePath = this.options.site_url + 'js/vendor/leaflet/images';
|
L.Icon.Default.imagePath = this.options.site_url + 'js/vendor/leaflet/images';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue