Esempio n. 1
0
        public ActionResult AddWfsLayer(string url, WFSVersion wfsVersion)
        {
            string wfsUrl = null;

            try
            {
                wfsUrl = WFSManager.CreateGetCapabiltiesRequestUrl(url, wfsVersion);
            }
            catch (UriFormatException)
            {
                ModelState.AddModelError("", "The URL has wrong format");
            }

            if (ModelState.IsValid)
            {
                if (wfsVersion == WFSVersion.Unknown)
                {
                    wfsVersion = WFSManager.GetWFSVersionFromRequestUrl(url);
                    if (wfsVersion == WFSVersion.Unknown)
                    {
                        wfsVersion = WFSVersion.Ver110;
                    }
                }
                return(RedirectToAction("AddWfsLayer", new { @url = wfsUrl }));
            }
            var viewManager = new WfsLayersViewManager(GetCurrentUser(), SessionHandler.MySettings);
            var model       = viewManager.CreateAddWfsLayerViewModel(ModelState, url, Url.Action("UploadMapDataFile"), Url.Action("WfsLayers"));

            return(View(model));
        }
Esempio n. 2
0
        public ActionResult AddWfsLayer(string url)
        {
            var viewManager = new WfsLayersViewManager(GetCurrentUser(), SessionHandler.MySettings);
            var model       = viewManager.CreateAddWfsLayerViewModel(ModelState, url, Url.Action("UploadMapDataFile"), Url.Action("WfsLayers"));

            return(View(model));
        }