Table of Contents [Hide/Show]
ExportMap ExportMapOptions ExportMapResult ExampleFind FindOperationOptions ExampleGetAvailableLayers ExampleIdentify IdentifyOptions ExampleQuery SpatialQueryOptions ExampleQueryObjectIds ExampleSee Also
var exportOptions = new ExportMapOptions { BoundingBox = options.ViewExtent, LayerIds = options.MapServiceLayers[i].VisibleLayerIds, TransparentMap = true, BoundingBoxSpatialReference =options.BoundingBoxSpatialReference, ImageFormat = ImageFormats.PNG24, Size =(options.ShowLegend)? new Size {Height = 1300, Width = 1500} : new Size {Height = 995, Width = 1600} }; var svs = new SpatialQueryService(options.MapServiceLayers[i].Url); ExportMapResult result = svs.ExportMap(exportOptions,"URL FOR MAPSERVICE");
var options = new FindOperationOptions { ExactMatchOnly = parameters.ExactMatch, Layers = _mapService.Layers.Where(l => layerIds.Contains(l.Id.ToString() ) ).Select(l => l.Layer).ToList(), ReturnGeometry = true, SearchFields = parameters.Attributes.Select(a => a.Name).ToList(), SearchText = parameters.SearchValue, SpatialReference = MapHandler.MapSpatialReference }; var client = new QueryServiceClient(); var results = client.Find(options,"URL FOR MAPSERVICE");
QueryServiceClient querySvs = new QueryServiceClient(); var results= querySvs.GetAvailableLayers(Url);
var options = new IdentifyOptions { Geometry = geometry, GeometryType = GeometryTypes.Point, ImageDisplay = new ImageDisplay { Dpi = (int)MapHandler.CurrentMap.Resolution, Height = (int)MapHandler.CurrentMap.ActualHeight, Width = (int)MapHandler.CurrentMap.ActualWidth }, Tolerance = 5, ReturnGeometry = true, LayerOptions = new LayersOptions { IdentifyLayerLevel = IdentifyLayerLevels.All, LayerIds = layerIds }, MapExtent = GeometryTranslator.TranslateEnvelope(MapHandler.GetExtent()), SpatialReference = new SpatialReference { WellKnownId = MapHandler.CurrentMap.SpatialReference.WKID.ToString() } }; var client = new QueryServiceClient(); var results=client.Identify(options,"URL FOR MAPSERVICE");
var criteria = new Criteria { ComparisonType = ComparisonType.Equals, Value = ids.First(), Field = idField }; var secondaryCriteria = ids.Skip(1).Select(sc => new SecondaryCriteria { ComparisonType = ComparisonType.Equals, Value = sc, Field = idField, LogicalOperator = LogicalOperator.Or }).ToList(); var sqo = new SpatialQueryOptions { Criteria = criteria, InputSpatialReference = MapHandler.MapSpatialReference, OutputSpatialReference = MapHandler.MapSpatialReference, Layer = layer, ReturnAllFields = true, ReturnGeometry = true, SecondaryCriteria = secondaryCriteria }; var client = new QueryServiceClient(); var result= client.Query(sqo,"URL FOR MAPSERVICE");
var criteria = new Criteria { ComparisonType = ComparisonType.Equals, Value = ids.First(), Field = idField }; var secondaryCriteria = ids.Skip(1).Select(sc => new SecondaryCriteria { ComparisonType = ComparisonType.Equals, Value = sc, Field = idField, LogicalOperator = LogicalOperator.Or }).ToList(); var sqo = new SpatialQueryOptions { Criteria = criteria, InputSpatialReference = MapHandler.MapSpatialReference, OutputSpatialReference = MapHandler.MapSpatialReference, Layer = layer, ReturnAllFields = true, ReturnGeometry = true, SecondaryCriteria = secondaryCriteria }; var client = new QueryServiceClient(); var result= client.QueryObjectIds(sqo,"URL FOR MAPSERVICE");