-
expression
String
Arcade 表达式计算为字典。字典必须表示 TextContent 、 FieldsContent 或 MediaContent 弹出内容元素,如 Popup Element web map specification 中定义的那样。
此表达式可以使用
$feature
、$layer
、$map
和$datastore
全局变量从Map或数据存储中的要素、其图层或其他图层访问数据值。有关有效返回字典的更多信息和示例,请参阅Popup Element Arcade Profile 规范。例子:
// Creates an column chart where each category/value // is an aggregate of two or more fields layer.popupTemplate = { title: "Educational Attainment", content: [{ type: "expression", expressionInfo: { expression: ` // Create a dictionary of attributes representing the values // to display in the table var attributes = { "No School": $feature.no_school + $feature.some_primary, "Primary": $feature.primary_complete + $feature.some_secondary, "Secondary": $feature.secondary_complete + $feature.some_highSchool, "High School": $feature.highSchool_diploma + $feature.highSchool_ged + $feature.some_college, "College/University": $feature.associates + $feature.bachelors + $feature.masters + $feature.doctorate + $feature.professional; }; var fieldInfos = []; // Create an array representing the attribute names (or keys) // to include in the chart for (var k in attributes){ Push(fieldInfos, { fieldName: k }); } // Returns a dictionary providing the information // required by the popup to render a table of key value pairs return { type: "media", attributes: attributes, // The list of attribute names (keys) to include in the table fieldInfos: fieldInfos }; `, title: "Educational Attainment" } }] };
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/popup/ElementExpressionInfo"], (ElementExpressionInfo) => { /* code goes here */ });
ESM:
import ElementExpressionInfo from "@arcgis/core/popup/ElementExpressionInfo";
类:
esri/popup/ElementExpressionInfo
继承: ElementExpressionInfo > Accessor
自从:用于 JavaScript 4.22 的 ArcGIS API
用法说明
ElementExpressionInfo.expression
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS ElementExpressionInfo用法及代码示例
- JavaScript ArcGIS Element.visibilityExpression用法及代码示例
- JavaScript ArcGIS ElevationProfile.profiles用法及代码示例
- JavaScript ArcGIS ElevationLayer.fullExtent用法及代码示例
- JavaScript ArcGIS ElevationLayer layerview-create-error事件用法及代码示例
- JavaScript ArcGIS ElevationLayer.on用法及代码示例
- JavaScript ArcGIS ElevationProfile.visibleElements用法及代码示例
- JavaScript ArcGIS ElevationSampler.on用法及代码示例
- JavaScript ArcGIS ElevationLayer用法及代码示例
- JavaScript ArcGIS ElevationProfile.when用法及代码示例
- JavaScript ArcGIS ElevationProfile.container用法及代码示例
- JavaScript ArcGIS ElevationProfile.classes用法及代码示例
- JavaScript ArcGIS ElevationLayer layerview-create事件用法及代码示例
- JavaScript ArcGIS ElevationLayer.portalItem用法及代码示例
- JavaScript ArcGIS ElevationProfile用法及代码示例
- JavaScript ArcGIS ElevationLayer.visible用法及代码示例
- JavaScript ArcGIS ElevationLayer.when用法及代码示例
- JavaScript ArcGIS ElevationLayer.queryElevation用法及代码示例
- JavaScript ArcGIS ElevationProfile.on用法及代码示例
- JavaScript ArcGIS ElevationLayer.url用法及代码示例
- JavaScript ArcGIS ElevationSampler changed事件用法及代码示例
- JavaScript ArcGIS ElevationSampler用法及代码示例
- JavaScript ArcGIS ElevationProfile.visible用法及代码示例
- JavaScript ArcGIS Expand.when用法及代码示例
- JavaScript ArcGIS ExtrudeSymbol3DLayer.castShadows用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 ElementExpressionInfo.expression。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。