Fix check for valid distance in drawCircle()

This commit is contained in:
Bjorge Dijkstra 2016-02-18 20:47:17 +01:00
parent 3a98bf0d00
commit a283ab2786

View file

@ -894,10 +894,11 @@ function resetMap() {
function drawCircle(marker, distance) {
if (typeof distance === 'undefined') {
return false;
if (!(!isNaN(parseFloat(distance)) && isFinite(distance)) || distance < 0) {
return false;
}
distance = parseFloat(distance);
if (isNaN(distance) || !isFinite(distance) || distance < 0) {
return false;
}
distance *= 1000.0;