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:
<SPAN class="keyword token">const</SPAN> features<SPAN class="punctuation token">:</SPAN> __esri<SPAN class="punctuation token">.</SPAN>Graphic<SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
features<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>MapViewService<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setPopupTemplateOnFeature</SPAN><SPAN class="punctuation token">(</SPAN>spaceInfo<SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
title<SPAN class="punctuation token">:</SPAN> space<SPAN class="punctuation token">,</SPAN>
content<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>popupTemplate<SPAN class="punctuation token">.</SPAN>nativeElement
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>MapViewService<SPAN class="punctuation token">.</SPAN>mapView<SPAN class="punctuation token">.</SPAN>popup<SPAN class="punctuation token">.</SPAN><SPAN class="token function">open</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
features<SPAN class="punctuation token">:</SPAN> features
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN> <SPAN class="token function">setPopupTemplateOnFeature</SPAN><SPAN class="punctuation token">(</SPAN>feature<SPAN class="punctuation token">:</SPAN> __esri<SPAN class="punctuation token">.</SPAN>Graphic<SPAN class="punctuation token">,</SPAN> template<SPAN class="punctuation token">:</SPAN> __esri<SPAN class="punctuation token">.</SPAN>PopupTemplateProperties<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> __esri<SPAN class="punctuation token">.</SPAN>Graphic <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">const</SPAN> newTemplate <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">this<SPAN class="punctuation token">.</SPAN>PopupTemplate</SPAN><SPAN class="punctuation token">(</SPAN>template<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
feature<SPAN class="punctuation token">.</SPAN>popupTemplate <SPAN class="operator token">=</SPAN> newTemplate<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">return</SPAN> feature<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>side note: the "this" on "this.PopupTemplate()" is because of the way loading pieces of the API is handled.