基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/popup/content/TextContent"], (TextContent) => { /* code goes here */ });
ESM:
import TextContent from "@arcgis/core/popup/content/TextContent";
類:
esri/popup/content/TextContent
繼承: TextContent > Content > Accessor
自從:用於 JavaScript 4.11 的 ArcGIS API
用法說明
TextContent
彈出元素用於將說明性文本定義為 PopupTemplate's 內容中的元素。文本可以引用從字段屬性返回的值或在 PopupTemplate 的 expressionInfos 屬性中定義的 Arcade 表達式。
.
例子:
// Create the Text Content Element
// This element uses an attribute from the featurelayer which displays a sentence
// giving the total amount of trees value within a specified census block.
let textElement = new TextContent();
textElement.text = "There are {Point_Count} trees within census block {BLOCKCE10}";
// // Create the PopupTemplate
let template = new PopupTemplate({
title: "Beverly Hills trees by block",
outFields: ["*"],
content: [textElement]
});
layer.popupTemplate = {
content: [{
type: "text", // Autocasts as new TextContent
text: "The {expression/predominance-tree} species occurs more often"
+ " than other tree species in the area."
}]
};
相關用法
- JavaScript ArcGIS TextSymbol3DLayer.halo用法及代碼示例
- JavaScript ArcGIS TextSymbol.angle用法及代碼示例
- JavaScript ArcGIS TextSymbol用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer.size用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer.background用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer.text用法及代碼示例
- JavaScript ArcGIS TextSymbol.clone用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer用法及代碼示例
- JavaScript ArcGIS TextSymbol.xoffset用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer.clone用法及代碼示例
- JavaScript ArcGIS TextSymbol.lineWidth用法及代碼示例
- JavaScript ArcGIS TextSymbol3DLayer.material用法及代碼示例
- JavaScript ArcGIS TextSymbol.yoffset用法及代碼示例
- JavaScript ArcGIS TextSymbol.lineHeight用法及代碼示例
- JavaScript ArcGIS TextSymbol.color用法及代碼示例
- JavaScript ArcGIS TextSymbol.haloSize用法及代碼示例
- JavaScript ArcGIS TextSymbol.font用法及代碼示例
- JavaScript ArcGIS TextSymbol.haloColor用法及代碼示例
- JavaScript ArcGIS TextSymbol.text用法及代碼示例
- JavaScript ArcGIS Terminal用法及代碼示例
- JavaScript ArcGIS TerminalConfiguration用法及代碼示例
- JavaScript TimeSlider.container用法及代碼示例
- JavaScript TypedArray.sort()用法及代碼示例
- JavaScript TimeSlider.next用法及代碼示例
- JavaScript Track.classes用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 TextContent。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。