private void initiateMapRequest(Wms.Client.Server server) { this.statusBar.Text = "Retrieving Map "; // Create a GetMap request for the layers COASTLINES and RATMIN (min temperatures). Wms.Client.MapRequestBuilder mapRequest = new Wms.Client.MapRequestBuilder( new System.Uri(server.Capabilities.GetCapabilitiesRequestUri)); mapRequest.Layers = "COASTLINES,RATMIN"; mapRequest.Styles = ","; // use default style for each layer mapRequest.Format = "image/gif"; mapRequest.Srs = "EPSG:4326"; mapRequest.BoundingBox = "-180.0,-90.0,180.0,90.0"; mapRequest.Height = 300; mapRequest.Width = 600; mapRequest.Transparent = false; // Create a retriever to execute the request. Wms.Client.MapRetriever mapRetriever = new Wms.Client.MapRetriever(this); mapRetriever.ProgressInterval = new System.TimeSpan(0, 0, 0, 0, 500); mapRetriever.Done += new Wms.Client.RetrieverDoneEventHandler(this.mapRetrieveDone); mapRetriever.Progress += new Wms.Client.RetrieverProgressEventHandler(this.showMapProgress); mapRetriever.Request = mapRequest; mapRetriever.Destination = System.IO.Path.GetTempFileName(); // Start the retrieval. mapRetriever.Start(); }
private void initiateMapRequest(Wms.Client.Server server) { this.statusBar.Text = "Retrieving Maps "; for (int i = 0; i < this.mapRequests.Length; i++) { // Create a GetMap request for the layers COASTLINES and Cloud Cover. this.mapRequests[i] = new Wms.Client.MapRequestBuilder( new System.Uri(server.Capabilities.GetCapabilitiesRequestUri)); this.mapRequests[i].Layers = "COASTLINES,RCOXXR"; this.mapRequests[i].Styles = ","; // use default style for each layer this.mapRequests[i].Format = "image/gif"; this.mapRequests[i].Srs = "EPSG:4326"; this.mapRequests[i].BoundingBox = "-180.0,-90.0,180.0,90.0"; this.mapRequests[i].Height = 300; this.mapRequests[i].Width = 600; this.mapRequests[i].Transparent = false; this.mapRequests[i].Time = System.String.Format("2004-05-{0:D2}", i + 1); // Create a retriever to execute the request. Wms.Client.MapRetriever mapRetriever = new Wms.Client.MapRetriever(this); mapRetriever.ProgressInterval = new System.TimeSpan(0, 0, 0, 0, 500); mapRetriever.Done += new Wms.Client.RetrieverDoneEventHandler(this.mapRetrieveDone); mapRetriever.Request = this.mapRequests[i]; mapRetriever.Destination = System.IO.Path.GetTempFileName(); // Slow connections may require more than the default 60 second // timeout period for map requests, so increase it to 180 seconds. mapRetriever.TimeoutInterval = System.TimeSpan.FromSeconds(180); // Start the retrieval. mapRetriever.Start(); // Initialize the progress bar and start the progress timer. this.statusBar.Text = "Retrieving Maps"; this.progressBar.Visible = true; this.timer.Start(); } }