Handle cases where the x-axis distance cannot be calculated
Merge pull request #2406 from ahocevar/scaleline-infinite

Infinite loop in ol.control.ScaleLine