Skip to content
This repository was archived by the owner on Nov 25, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Geocoding/ForwardGeocodeResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public override string GetUrl()
if (this.Proximity != null)
{
var nonNullableProx = (Vector2d)this.Proximity;
opts.Add("proximity", nonNullableProx.ToString());
opts.Add("proximity", nonNullableProx.SerializeToLonLat());
}

if (this.Types != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Geocoding/ReverseGeocodeResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override string GetUrl()
return Constants.BaseAPI +
this.ApiEndpoint +
this.Mode +
this.Query.ToString() +
this.Query.SerializeToLonLat() +
".json" +
EncodeQueryString(opts);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/GeoCoordinateBounds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public double[] ToArray()
/// <returns> Returns a string for use in a Mapbox query URL. </returns>
public override string ToString()
{
return string.Format("{0},{1}", this.SouthWest.ToString(), this.NorthEast.ToString());
return string.Format("{0},{1}", this.SouthWest.SerializeToLonLat(), this.NorthEast.SerializeToLonLat());
}
}
}
5 changes: 5 additions & 0 deletions src/Utils/Vector2d/Vector2d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ public void Normalize()
}

public override string ToString()
{
return string.Format(NumberFormatInfo.InvariantInfo, "{0:F5},{1:F5}", this.x, this.y);
}

public string SerializeToLonLat()
{
return string.Format(NumberFormatInfo.InvariantInfo, "{0:F5},{1:F5}", this.y, this.x);
}
Expand Down