public void SomeMethod() { _geometryService = new GeometryService("some URL here..."); _geometryService.LabelPointsCompleted += OnLabelPointsCompleted; _geometryService.SimplifyCompleted += OnSimplifyCompleted; _geometryService.BufferCompleted += OnBufferCompleted; _geometryService.SimplifyAsync(_polylines); // Start by simplifying the polyline graphics to find the label points for } private void OnSimplifyCompleted(object sender, GraphicsEventArgs e) { var bufferParams = new BufferParameters(); bufferParams.BufferSpatialReference = _spatialReference; // whatever spatial reference you need bufferParams.OutSpatialReference = _spatialReference; bufferParams.Unit = LinearUnit.Centimeter; bufferParams.Distances.Add(1.0d); bufferParams.Features.AddRange(e.Results); _geometryService.BufferAsync(bufferParams); } private void OnBufferCompleted(object sender, GraphicsEventArgs e) { _geometryService.LabelPointsAsync(e.Results); } private void OnLabelPointsCompleted(object sender, GraphicsEventArgs e) { // Do someting with label points... }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.