-
activeTool
String
指定要顯示的當前測量工具。將其值設置為
area
會激活麵積測量工具,它適用於 MapView 和 SceneView 。要在 MapView 中測量距離,請將屬性設置為distance
並在 SceneView 中將其設置為direct-line
。如果未設置此屬性,則不會顯示小部件。可能的值:"area"|"distance"|"direct-line"
默認值:null
例子:
// To create the Measurement widget with SceneView's direct-line tool active. const measurement = new Measurement({ view: view, activeTool: "direct-line" }); // To switch between direct line and area measurement tools function switchTool() { const tool = measurement.activeTool === "direct-line" ? "area" : "direct-line"; measurement.activeTool = tool; }
基本信息
以下是所在類或對象的基本信息。
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.activeTool
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Measurement.activeWidget用法及代碼示例
- JavaScript ArcGIS Measurement.areaUnit用法及代碼示例
- JavaScript ArcGIS Measurement.on用法及代碼示例
- JavaScript ArcGIS Measurement.container用法及代碼示例
- JavaScript ArcGIS Measurement.startMeasurement用法及代碼示例
- JavaScript ArcGIS Measurement.visible用法及代碼示例
- JavaScript ArcGIS Measurement.linearUnit用法及代碼示例
- JavaScript ArcGIS Measurement.classes用法及代碼示例
- JavaScript ArcGIS Measurement.view用法及代碼示例
- JavaScript ArcGIS Measurement.viewModel用法及代碼示例
- JavaScript ArcGIS Measurement.when用法及代碼示例
- JavaScript ArcGIS Measurement用法及代碼示例
- JavaScript ArcGIS MeshComponent.faces用法及代碼示例
- JavaScript ArcGIS MediaContent用法及代碼示例
- JavaScript ArcGIS MeshSymbol3D用法及代碼示例
- JavaScript ArcGIS Mesh.rotate用法及代碼示例
- JavaScript ArcGIS MeshSymbol3D.clone用法及代碼示例
- JavaScript ArcGIS MeshTexture.wrap用法及代碼示例
- JavaScript ArcGIS MeshComponent用法及代碼示例
- JavaScript ArcGIS MeshTexture用法及代碼示例
- JavaScript ArcGIS Mesh.vertexAttributes用法及代碼示例
- JavaScript ArcGIS Mesh.createBox用法及代碼示例
- JavaScript ArcGIS Mesh用法及代碼示例
- JavaScript ArcGIS MeshMaterial用法及代碼示例
- JavaScript ArcGIS MultipointDrawAction vertex-add事件用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Measurement.activeTool。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。