public static WMSZoomBuilder GetBuilderFromURI(string uri, WMSCatalogBuilder provider, WorldWindow worldWindow, WMSServerBuilder wmsserver) { string strServer = ""; string strLayer = ""; int pixelsize = 1024; try { ParseURI(uri, ref strServer, ref strLayer, ref pixelsize); WMSList oServer = provider.FindServer(strServer); foreach (WMSLayer layer in oServer.Layers) { WMSLayer result = FindLayer(strLayer, layer); if (result != null) { WMSZoomBuilder zoomBuilder = wmsserver.FindLayerBuilder(result); if (zoomBuilder != null) { zoomBuilder.ImagePixelSize = pixelsize; return(zoomBuilder); } } } } catch { } return(null); }
private static void ParseURI(string uri, ref string strCapURL, ref string strLayer, ref int pixelsize) { strCapURL = uri.Replace(URLProtocolName, "http://"); int iIndex = strCapURL.LastIndexOf("&"); if (iIndex != -1) { pixelsize = Convert.ToInt32(strCapURL.Substring(iIndex).Replace("&startpixelsize=", "")); strCapURL = strCapURL.Substring(0, iIndex); } else { return; } iIndex = strCapURL.LastIndexOf("&"); if (iIndex != -1) { strLayer = strCapURL.Substring(iIndex).Replace("&layer=", ""); strCapURL = strCapURL.Substring(0, iIndex).Trim(); } else { return; } WMSCatalogBuilder.TrimCapabilitiesURL(ref strCapURL); }
public static WMSZoomBuilder GetBuilderFromURI(string uri, WMSCatalogBuilder provider, WorldWindow worldWindow, WMSServerBuilder wmsserver) { string strServer = ""; string strLayer = ""; int pixelsize = 1024; try { ParseURI(uri, ref strServer, ref strLayer, ref pixelsize); WMSList oServer = provider.FindServer(strServer); foreach (WMSLayer layer in oServer.Layers) { WMSLayer result = FindLayer(strLayer, layer); if (result != null) { WMSZoomBuilder zoomBuilder = wmsserver.FindLayerBuilder(result); if (zoomBuilder != null) { zoomBuilder.ImagePixelSize = pixelsize; return zoomBuilder; } } } } catch { } return null; }