當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


JavaScript ArcGIS TraceLocation.percentAlong用法及代碼示例


基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/rest/networks/support/TraceLocation"], (TraceLocation) => { /* code goes here */ });

ESM: import TraceLocation from "@arcgis/core/rest/networks/support/TraceLocation";

類: esri/rest/networks/support/TraceLocation

繼承: TraceLocation > Accessor

自從:用於 JavaScript 4.20 的 ArcGIS API

用法說明

TraceLocation.percentAlong函數(或屬性)的定義如下:

percentAlong Number


這個值為 0-1 的雙參數表示沿著放置跟蹤位置的線的百分比。僅適用於線要素。

例子:

Line feature with objectId 100 with 2 midspan junctions (j1,j2). The line feature has 3 edge network elements
F-j1, j1-j2 and j2-T.

                                       OID=100
                               F------j1------j2------T

F-j1  (objectId=100, positionFrom=0, positionTo=0.33)
j1-j2 (objectId=100, positionFrom=0.33, positionTo=0.66)
j2-T  (objectId=100, positionFrom=0.66, positionTo=1)

When percentAlong is 0.5 (50%) the starting location will be placed on the middle edge (j1-j2)

                                       OID=100
                               F------j1---x--j2------T

When percentAlong is 0.1 (10%) the starting location will be placed on the first edge (F-j1)

                                       OID=100
                               F-x----j1------j2------T

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 TraceLocation.percentAlong。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。