Select to view content in your preferred language

Measure Lengths Sample - Label at the end ?

850
3
Jump to solution
05-01-2013 01:17 PM
ionarawilson1
Deactivated User
Hi,

I am implementing the measure lengths in my app. What do I  need to code differently if I want to add the label at the end of the line and not at the beginning?


http://help.arcgis.com/en/webapi/flex/samples/index.html#//01nq0000000n000000


The drawhandler function now has:

     latestEndpoint = drawnLine.paths[0][0] as MapPoint;

Is there a way to change that to have the label appear at the end, although I don't have a limit for the length? Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BjornSvensson
Esri Regular Contributor
...implementing the measure lengths...Is there a way to change that to have the label appear at the end, although I don't have a limit for the length?


Yes, you can check for the actual length of it.  For example, this API sample displays it at the middle of the line:
http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Clientside_Geodesic_calculations/01...
var mid:int = Polyline(userGeometry).paths[0].length / 2; pt = Polyline(userGeometry).paths[0][mid];

View solution in original post

0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
...implementing the measure lengths...Is there a way to change that to have the label appear at the end, although I don't have a limit for the length?


Yes, you can check for the actual length of it.  For example, this API sample displays it at the middle of the line:
http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Clientside_Geodesic_calculations/01...
var mid:int = Polyline(userGeometry).paths[0].length / 2; pt = Polyline(userGeometry).paths[0][mid];
0 Kudos
ionarawilson1
Deactivated User
Thank you Bjorn. Exactly what I needed.
0 Kudos
AlKamuda
Deactivated User
Is there a way to add this to the feature edit tools and how much copy paste to make it work? I'm looking to try to have the length display while a web user is adding new line feature to a feature service. Then again is this even possible.
Thanks
0 Kudos