I get the following error when trying to open the MapView's popup with an input feature whose geometry is a Point:
Unhandled Promise rejection: [accessor] cannot assign to read-only property 'cache' of esri.geometry.Point ; Zone: <root> ; Task: Promise.then ; Value: TypeError: [accessor] cannot assign to read-only property 'cache' of esri.geometry.Point
The Code:
const features: __esri.Graphic[] = [];
features.push(this.MapViewService.setPopupTemplateOnFeature(spaceInfo, {
title: space,
content: this.popupTemplate.nativeElement
}));
this.MapViewService.mapView.popup.open({
features: features
});
setPopupTemplateOnFeature(feature: __esri.Graphic, template: __esri.PopupTemplateProperties): __esri.Graphic {
const newTemplate = new this.PopupTemplate(template);
feature.popupTemplate = newTemplate;
return feature;
}
side note: the "this" on "this.PopupTemplate()" is because of the way loading pieces of the API is handled.