dissimulator

Calculating label points for polyline features

Discussion created by dissimulator on Nov 24, 2011
Latest reply on Nov 24, 2011 by dissimulator
I am writing an application using the Silverlight toolkit to display pipe networks. I need to be able to annotate some of the pipes with additional data and to do this I would like to add a TextSymbol to the middle point of the pipe.

Calculating the center point of the bounding envelope is unsatisfactory when the pipe is curved or looped; the label ends up far away from the pipe.

I have tried to use the Geometry Service REST API and call the Label Points operation. However, it appears the Label Points operation doesn???t support Polylines (the pipes) but only Polygons. Attempting to pass the Polylines to the Geometry Service results in an ???Object reference not set to an instance of an object??? error being returned.

Does anyone have any suggestions about how I can get the Label Point for a Polyline?

Outcomes