Andras,
Here below is how we generate Google Request link in Map Suite 9 (which is compatible with v4.5).
private string GetRequestImageUrl(double lon, double lat, int zoomLevelNumber, double tileWidth, double tileHeight)
{
string regionInfoParameters = GetRegionInfoParameters(tileWidth, tileHeight, zoomLevelNumber, lon, lat);
StringBuilder requestStringBuilder = new StringBuilder("http://maps.googleapis.com/maps/api/staticmap?");
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}&", regionInfoParameters);
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "maptype={0}&", GetMapType());
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "format={0}&", GetPictureFormat());
requestStringBuilder.Append("sensor=false");
if (!string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(privateKey))
{
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "&client={0}", clientId);
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "&signature={0}", GetSignature(requestStringBuilder.ToString()));
}
if(!string.IsNullOrEmpty(Language))
{
requestStringBuilder.AppendFormat(CultureInfo.InvariantCulture, "&language={0}", Language);
}
return requestStringBuilder.ToString();
}
private static string GetRegionInfoParameters(double newWidth, double newHeight, int zoomLevelNumber, double longitude, double latitude)
{
StringBuilder regionInfo = new StringBuilder();
regionInfo.AppendFormat(CultureInfo.InvariantCulture, "center={0},{1}&", Math.Round(latitude, 6), Math.Round(longitude, 6));
regionInfo.AppendFormat(CultureInfo.InvariantCulture, "zoom={0}&", zoomLevelNumber);
regionInfo.AppendFormat(CultureInfo.InvariantCulture, "size={0}x{1}", (int)newWidth, (int)newHeight);
return regionInfo.ToString();
}
The only thing to be aware of is Google recommended to use ApiKey now instead of ClientID/PrivateKey, so you can simply remove the ClientId/PrivateKey and attach the ApiKey to the URI if what you are using for authentication is ApiKey. Check out Google’s doc Overview | Maps Static API | Google Developers for the detail.
Thanks,
Ben