当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS Measurement.linearUnit用法及代码示例


基本信息

以下是所在类或对象的基本信息。

AMD: require(["esri/widgets/Measurement"], (Measurement) => { /* code goes here */ });

ESM: import Measurement from "@arcgis/core/widgets/Measurement";

类: esri/widgets/Measurement

继承: Measurement > Widget > Accessor

自从:用于 JavaScript 4.13 的 ArcGIS API

用法说明

Measurement.linearUnit函数(或属性)的定义如下:

linearUnit SystemOrLengthUnit


用于显示距离值的单位系统(英制、公制)或特定单位。可能的值为:metric , imperial , inches , feet , us-feet , yards , miles , nautical-miles , meters , kilometers

例子:

// To create the Measurement widget that displays distance in yards
const measurement = new Measurement({
  view: view,
  activeTool: "distance",
  linearUnit: "yards"
});

// To display the current measurement unit
console.log('Current linear unit: ', measurement.linearUnit);

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 Measurement.linearUnit。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。