Example #1
0
        public override bool GetMap(GISService activeService, List<GISLayerInfo> mapLayers, GISEnvelope mapEnvelope, double zoomLevel, string requestString)
        {
            OGCImageResponse response = new OGCImageResponse();

            try
            {
                response.Envelope = mapEnvelope;
                response.Layers = mapLayers;
                OGCEnvelope ogcEnvelope = new OGCEnvelope(mapEnvelope);

                //string currentlayerId = mapLayers[0]._id;
                //string styleId = (mapLayers[0] as OGCLayer).Style;

                //for (int i = 1; i < mapLayers.Count; i++)
                //{
                //    currentlayerId = string.Format("{0},{1}", currentlayerId, mapLayers[i]._id);
                //}

                //for (int i = 1; i < mapLayers.Count; i++)
                //{
                //    if (!string.IsNullOrEmpty((mapLayers[i] as OGCLayer).Style))
                //    {
                //        styleId = string.Format("{0},{1}", styleId, (mapLayers[i] as OGCLayer).Style);
                //    }
                //}

                response.LastRequest = requestString;

                response.LastResponse = "Complete";
                response._mapImageUrl = requestString;
                response.ZoomLevel = zoomLevel;
                Server.RaiseMapResponse(response);
                return true;
            }
            catch (System.Exception ex)
            {
                Server.RaiseErrorResponse(new GISResponse() { LastResponse = ex.Message, ErrorMessage = ex.Message, HasError = true, LastRequest = requestString, _envelope = response.Envelope, _layers = mapLayers });
            }

            return false;
        }
Example #2
0
 // starts at IMAGE begin element
 public static OGCImageResponse ProcessImageReturn(string requestString, GISEnvelope responseEnvelope)
 {
     OGCImageResponse response = new OGCImageResponse();
     response.LastRequest = requestString;
     return response;
 }
Example #3
0
        public override bool GetMap(GISService activeService, GISEnvelope imageEnvelope)
        {
            OGCImageResponse response = new OGCImageResponse();

            if (activeService.HasLayers || GetServiceDetails(activeService).Result)
            {
                if (activeService._activeLayers.Count == 0)
                {
                    for (int i = 0; i < activeService._baseLayers.Count; i++)
                    {
                        if (activeService._baseLayers[i].IsVisible && activeService._baseLayers[i]._baseExtent != null)
                        {
                            activeService._activeLayers.Add(activeService._baseLayers[i]);
                        }
                    }
                }

                return GetMap(activeService, imageEnvelope, activeService._activeLayers.ToList());
            }
            else
            {
                Server.RaiseErrorResponse(GISResponse.ProcessErrorResponse("Services could not be located for this server at this time.", "", ""));
                return false;
            }
        }