Topic: Wrong formated stringbuilder url resulting in bing 400 error
Hi there,
I just wondered why in one project the elevation was built correctly and in the other it was not.
Both projects used the exact same parameters. I even included the scene from the working one as a test.
After serveral debugging logs I saw, that the url in the working project has the lat&long values formatted correctly with ".", whereas the one not working had it formatted with "," - resulting in thinking the rest api receiving additional parameters.
I don't know why and where this wrong format is introduced... since as said, I used exact parameters, same plugin version etc.
As a workaround I wrote a little (clumsy) fix in OnlineMapsBingMapsElevation.cs:
public override void GenerateURL(StringBuilder builder)
{
base.GenerateURL(builder);
string bottomLatStr = (bottomLatitude.ToString()).Replace(",", ".");
string topLatStr = (topLatitude.ToString()).Replace(",", ".");
string leftLongStr= (leftLongitude.ToString()).Replace(",", ".");
string rightLongStr = (rightLongitude.ToString()).Replace(",", ".");
builder.Append("&bounds=").Append(bottomLatStr).Append(",").Append(leftLongStr).Append(",").Append(topLatStr).Append(",").Append(rightLongStr);
builder.Append("&rows=").Append(rows).Append("&cols=").Append(cols);
}
Best regards,
Andy