public string GetRequestUrl(BoundingBox box, int width, int height)
{
//ArcGIS Export description see: http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html?export.html
var sr = CreateSr(CRS);
var strReq = new StringBuilder(_url);
strReq.Append("/export?");
strReq.AppendFormat(CultureInfo.InvariantCulture, "bbox={0},{1},{2},{3}", box.Min.X, box.Min.Y, box.Max.X, box.Max.Y);
strReq.AppendFormat("&bboxSR={0}", sr);
strReq.AppendFormat("&imageSR={0}", sr);
strReq.AppendFormat("&size={0},{1}", width, height);
strReq.Append("&layers=show:");
if (!string.IsNullOrEmpty(Token))
{
strReq.Append($"&token={Token}");
}
/*
* Add all layers to the request that have defaultVisibility to true, the normal request to ArcGIS allready does this already
* without specifying "layers=show", but this adds the opportunity for the user to set the defaultVisibility of layers
* to false in the capabilities so different views (layers) can be created for one service
*/
var oneAdded = false;
foreach (var t in ArcGisDynamicCapabilities.layers)
{
if (t.defaultVisibility == false)
continue;
if (oneAdded)
strReq.Append(",");
strReq.AppendFormat("{0}", t.id);
oneAdded = true;
}
strReq.AppendFormat("&format={0}", GetFormat(ArcGisDynamicCapabilities));
strReq.Append("&transparent=true");
strReq.Append("&f=image");
return strReq.ToString();
}