示例#1
0
        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);
        }
示例#2
0
        protected override ModelNode[] Load()
        {
            WebDownload oCatalogDownload = new WebDownload(m_oUri.ToCapabilitiesUri(), true);

            oCatalogDownload.DownloadFile(CapabilitiesFilename);

            WMSList oCatalog = new WMSList(m_oUri.ToCapabilitiesUri(), CapabilitiesFilename);

            m_strTitle = oCatalog.Name;

            List <ModelNode> result = new List <ModelNode>();

            foreach (WMSLayer oLayer in oCatalog.Layers[0].ChildLayers)
            {
                if (oLayer.ChildLayers == null)
                {
                    result.Add(new WMSLayerModelNode(m_oModel, oLayer));
                }
                else
                {
                    result.Add(new WMSFolderModelNode(m_oModel, oLayer));
                }
            }
            if (oCatalog.Layers[0].Name != null)
            {
                result.Add(new WMSLayerModelNode(m_oModel, oCatalog.Layers[0]));
            }

            result.Sort(new Comparison <ModelNode>(WMSRootModelNode.SortWMSChildNodes));

            return(result.ToArray());
        }