Beispiel #1
0
 public RequestWorker(int order, WMSParamBase parameters, ICreateWMSRequest createWMSRequest, HttpContext current, WMSRequestType type)
 {
     this.order            = order;
     this.parameters       = parameters;
     this.createWMSRequest = createWMSRequest;
     this.current          = current;
     this.type             = type;
     this.exception        = null;
 }
Beispiel #2
0
        public HttpResponseObject WMSRequest(WMSRequestType wmsRequestType, WMSParamBase wms)
        {
            if (string.IsNullOrEmpty(wms.LAYERS))
            {
                return(null);
            }

            string query;

            switch (wmsRequestType)
            {
            case WMSRequestType.OverlayEMSGLayer:
                query = new CreateWMSQuery().CreateMapRequestString((WMSRestParameter)wms, securityService.GetCurrentMandant().Id);
                return(SendHttpRequest.WmsRequest(new HttpRequestObject(new ServerConfigurationProvider().WMSUrl, query, contentType: wms.FORMAT)));

            case WMSRequestType.BackgroundLayer:
                //((WMSParameter)wms).CRS = "EPSG:21781";
                query = new CreateWMSQuery().CreateBackgroundRequestString((WMSParameter)wms);
                return(SendHttpRequest.WmsRequest(new HttpRequestObject(new ServerConfigurationProvider().WMSUrlBaseLayer, query, contentType: wms.FORMAT)));

            case WMSRequestType.AVLayer:
                //((WMSParameter)wms).SRS = "EPSG:21781";
                query = new CreateWMSQuery().CreateBackgroundRequestString((WMSParameter)wms);
                return(SendHttpRequest.WmsRequest(new HttpRequestObject(new ServerConfigurationProvider().WMSAVUrl, query, contentType: wms.FORMAT)));

            case WMSRequestType.AVCLayer:
                //((WMSParameter)wms).SRS = "EPSG:21781";
                query = new CreateWMSQuery().CreateBackgroundRequestString((WMSParameter)wms);
                return(SendHttpRequest.WmsRequest(new HttpRequestObject(new ServerConfigurationProvider().SWMSAVUrl, query, contentType: wms.FORMAT, userName: new ServerConfigurationProvider().SWMSAVUserName, password: new ServerConfigurationProvider().SWMSAVPassword)));

            case WMSRequestType.WMTSLayer:
                //todo wenn anpassen wenn änderungsantrag durch ist
                break;

            default:
                throw new NotImplementedException();
            }

            return(null);
        }