官网API:
链接: PopupTemplate
环境版本
Vite+Vue3 Arcgis 4.24.7
引入
amd: require([“esri/PopupTemplate”]
esm: import PopupTemplate from ‘@arcgis/core/PopupTemplate’;
属性
content
actions
fieldInfos
outFields
title
实例
const template={
title: "{NAME} in {COUNTY}",
content: [
{
type: "fields",
fieldInfos: [
{
fieldName: "B12001_calc_pctMarriedE",
label: "Married %"
},
{
fieldName: "B12001_calc_numMarriedE",
label: "People Married",
format: {
digitSeparator: true,
places: 0
}
},
{
fieldName: "B12001_calc_numNeverE",
label: "People that Never Married",
format: {
digitSeparator: true,
places: 0
}
},
{
fieldName: "B12001_calc_numDivorcedE",
label: "People Divorced",
format: {
digitSeparator: true,
places: 0
}
}
]
}
]
};
const featureLayer = new FeatureLayer({
url: ……,
**popupTemplate: **template****
});
……
});