new LengthMeasurer(wwd)
Segments which are longer then the current maxSegmentLength will be subdivided along lines following the current pathType - WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE.
For follow terrain, the computed length will account for terrain deformations as if someone was walking along that path. Otherwise the length is the sum of the cartesian distance between the positions.
When following terrain the measurer will sample terrain elevations at regular intervals along the path. The minimum number of samples used for the whole length can be set with lengthTerrainSamplingSteps. However, the minimum sampling interval is 30 meters.
Parameters:
Name | Type | Description |
---|---|---|
wwd |
WorldWindow | The WorldWindow associated with LengthMeasurer. |
- Source:
Throws:
-
If the specified WorldWindow is null or undefined.
- Type
- ArgumentError
Members
lengthTerrainSamplingSteps :Number
Type:
- Number
- Source:
maxSegmentLength :Number
Type:
- Number
- Source:
Methods
computeLength(positions, followTerrain, pathType)
Parameters:
Name | Type | Description |
---|---|---|
positions |
Array.<Position> | |
followTerrain |
Boolean | |
pathType |
String | One of WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE |
- Source:
getGeographicDistance(path, pathType) → {Number}
Parameters:
Name | Type | Description |
---|---|---|
path |
Path | Array.<Position> | A Path or an array of Positions |
pathType |
String | Optional argument used when path is an array of Positions.
Defaults to WorldWind.GREAT_CIRCLE.
Recognized values are:
|
- Source:
Returns:
- Type
- Number
getLength(positions, followTerrain, pathType)
If followTerrain is true, the computed length will account for terrain deformations as if someone was walking along that path. Otherwise the length is the sum of the cartesian distance between each positions.
Parameters:
Name | Type | Description |
---|---|---|
positions |
Array.<Position> | |
followTerrain |
Boolean | |
pathType |
String | One of WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE |
- Source:
Returns:
getPathLength(path)
If the path's followTerrain is true, the computed length will account for terrain deformations as if someone was walking along that path. Otherwise the length is the sum of the cartesian distance between each positions.
Parameters:
Name | Type | Description |
---|---|---|
path |
Path |
- Source: