|
@@ -2604,6 +2604,12 @@ ${ hueIcons.symbols() }
|
|
|
return _data;
|
|
return _data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // The leaflet map can freeze the browser with numbers outside the map
|
|
|
|
|
+ var MIN_LAT = -85;
|
|
|
|
|
+ var MAX_LAT = 85;
|
|
|
|
|
+ var MIN_LNG = -180;
|
|
|
|
|
+ var MAX_LNG = 180;
|
|
|
|
|
+
|
|
|
function leafletMapChartDataTransformer(rawDatum) {
|
|
function leafletMapChartDataTransformer(rawDatum) {
|
|
|
var _data = [];
|
|
var _data = [];
|
|
|
if (rawDatum.snippet.chartX() != null && rawDatum.snippet.chartYSingle() != null) {
|
|
if (rawDatum.snippet.chartX() != null && rawDatum.snippet.chartYSingle() != null) {
|
|
@@ -2624,8 +2630,8 @@ ${ hueIcons.symbols() }
|
|
|
if (rawDatum.snippet.chartMapLabel() != null) {
|
|
if (rawDatum.snippet.chartMapLabel() != null) {
|
|
|
$(rawDatum.counts()).each(function (cnt, item) {
|
|
$(rawDatum.counts()).each(function (cnt, item) {
|
|
|
_data.push({
|
|
_data.push({
|
|
|
- lat: item[_idxLat],
|
|
|
|
|
- lng: item[_idxLng],
|
|
|
|
|
|
|
+ lat: Math.min(Math.max(MIN_LAT, item[_idxLat]), MAX_LAT),
|
|
|
|
|
+ lng: Math.min(Math.max(MIN_LNG, item[_idxLng]), MAX_LNG),
|
|
|
label: hueUtils.html2text(item[_idxLabel]),
|
|
label: hueUtils.html2text(item[_idxLabel]),
|
|
|
obj: item
|
|
obj: item
|
|
|
});
|
|
});
|
|
@@ -2633,8 +2639,8 @@ ${ hueIcons.symbols() }
|
|
|
} else {
|
|
} else {
|
|
|
$(rawDatum.counts()).each(function (cnt, item) {
|
|
$(rawDatum.counts()).each(function (cnt, item) {
|
|
|
_data.push({
|
|
_data.push({
|
|
|
- lat: item[_idxLat],
|
|
|
|
|
- lng: item[_idxLng],
|
|
|
|
|
|
|
+ lat: Math.min(Math.max(MIN_LAT, item[_idxLat]), MAX_LAT),
|
|
|
|
|
+ lng: Math.min(Math.max(MIN_LNG, item[_idxLng]), MAX_LNG),
|
|
|
obj: item
|
|
obj: item
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|