PopupTemplate
的
content
方法:
layer.popupTemplate = new PopupTemplate({
content: (feature: { graphic: __esri.Graphic }) => {
this.publishPopupData(layer, feature.graphic.attributes);
return popupComponent.viewContainerRef.element.nativeElement;
},
// other properties...
});
这是很好的,除非在一个给定的点上有多个特性。当用户在这些特性之间循环时,如果他/她返回到已经显示的特性,则不会执行content方法,因此不会发布弹出数据。
MapView
mapView.popup.watch('selectedFeature', (graphic: __esri.Graphic) => {
const layer = ???;
this.publishPopupData(layer, graphic.attributes);
});
名义上,
graphic.layer
应该包含层引用,但是在我的例子中它总是
null
.
MapView.popup
(或者其他我没有考虑过的事情)?
如果重要的话,弹出窗口是为了
MapImageLayer