Select to view content in your preferred language

Set WMS Layer Parameters

2124
1
08-10-2012 09:38 AM
Matrix_Solutions_Inc_Geomatics
Regular Contributor
Hi,

I have a  WMS Layer of imagery rasters from a third party that has the ability to be time stamped:

Using arc catalogue I can turn this feature on in the service properties which then adds the bolded parameter:

/wms/servlet/WMSServer?userid=hidden&passwd=hidden&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-93.0562371212999,44.2252121686514,-92.7059804612417,44.3405684382141&WIDTH=1840&HEIGHT=606&LAYERS=VIEWS&STYLES=TIMESTAMP&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/png&BGCOLOR=0xFEFFFF&TRANSPARENT=TRUE

But i cant seem to find a way to set the 'STYLES' property for this WMS service when consuming it in our silverlight application:

wms/servlet/WMSServer?SERVICE=WMS&REQUEST=GetMap&WIDTH=1916&HEIGHT=985&FORMAT=image/png&LAYERS=VIEWS&STYLES=&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&VERSION=1.1.1&SRS=EPSG:102113&bbox=-15354698.8037831,5911008.84365087,-10031800.6579869,8647467.44156807


Any Ideas on how to set this?
0 Kudos
1 Reply
Matrix_Solutions_Inc_Geomatics
Regular Contributor
Figured it out, wasnt that hard at all.

just set the proxy to process the request and did some simple logic on the URI String.

 public void ProcessRequest(HttpContext context)
{   
    HttpResponse response = context.Response;

    // Get the URL requested by the client (take the entire querystring at once
    //  to handle the case of the URL itself containing querystring parameters)
    string uri = Uri.UnescapeDataString(context.Request.QueryString.ToString());


    // Get token, if applicable, and append to the request
    string token = getTokenFromConfigFile(uri);


    // Add the 'TIMESTAMP' Value  to the Valtus Service
    string styleparam = "&STYLES=";
    if (uri.Contains(styleparam))
    {
        int position = uri.IndexOf(styleparam) + styleparam.Length;
        uri = uri.Insert(position, "TIMESTAMP");
    }

    System.Net.WebRequest req = System.Net.WebRequest.Create(new Uri(uri));
}
0 Kudos