Broken onClick clusters working after validating longitude and latitude and only allowing locations to contain valid coordinates

This commit is contained in:
efarooqui
2020-10-01 15:35:46 -07:00
parent ed236e9716
commit 9357b5e281
5 changed files with 39 additions and 25 deletions

View File

@@ -172,6 +172,14 @@ export function calcClusterSize (pointCount, numClusters) {
return Math.min(50, 10 + (pointCount / numClusters) * 10)
}
export function isLatitude(lat) {
return !!lat && isFinite(lat) && Math.abs(lat) <= 90;
}
export function isLongitude(lng) {
return !!lng && isFinite(lng) && Math.abs(lng) <= 180;
}
export const dateMin = function () {
return Array.prototype.slice.call(arguments).reduce(function (a, b) {
return a < b ? a : b