Angular 11 アプリケーションの arcgis ポップアップ テンプレートに customContent を表示します。しかし、graphic.attributesの値がinnerText に来ていません。コンソール ログを見ると、グラフィック オブジェクトが期待どおりに表示されていることがわかります。しかし、それはgrahpic.attributesに対してundefinedを示しています 誰でもこの問題を解決するのを助けることができますか?
new CustomContent({
outFields: ["*"],
creator: (eventOrGraphic) => {
const graphic = eventOrGraphic instanceof Graphic ? eventOrGraphic : eventOrGraphic.graphic;
const a = document.createElement("a");
a.href = graphic.attributes.url;
a.target = "_blank";
a.innerText = graphic.attributes.url;
return a;
}
})
Console.log(eventOrGraphic)
graphic: p
destroy: ƒ value()
initialize: ƒ value()
uid: 1474
__accessor__: g {host: p, properties: Map(8), ctorArgs: null, destroyed: false, lifecycle: 2, …}
attributes: (...)
geometry: (...)
isAggregate: (...)
layer: (...)
popupTemplate: (...)
sourceLayer: (...)
symbol: (...)
visible: (...)
[[Prototype]]: Object
Console.log(graphic.attributes) - 未定義
arcgis-js-api(4.2.1)