-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
LngLat.fmtCoordinate returns wrong values when the "value" parameter is negative (for western/southern longitudes/latitudes, respectively).
Here's a patch:
--- a/haxemap/core/LngLat.hx
+++ b/haxemap/core/LngLat.hx
@@ -55,9 +55,10 @@ class LngLat
//convert coordinate to string (format %.6f)
static public function fmtCoordinate(value:Float) : String
{
- var valuef:Float = Math.floor(value);
- var f:Float = value - valuef;
- var s:String = Std.string(valuef) + ".";
+ var tmp_value:Float = (value > 0 ? value : -value);
+ var valuef:Float = Math.floor(tmp_value);
+ var f:Float = tmp_value - valuef;
+ var s:String = (value > 0 ? "" : "-") + Std.string(valuef) + ".";
for (i in 0...6)
{
f *= 10.0;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels