I am using the Web Map template in AppStudio. The third sample in this template is "We Map Identify"
I update the MAP section as seen below but the feature layer does not identify....Am I missing something????
In this .qml file is this code that seems to allow for the identify of a Feature Layer.
<SPAN class="comment token">// Signal handler for identify</SPAN>
onIdentifyLayersStatusChanged<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>identifyLayersStatus <SPAN class="operator token">===</SPAN> Enums<SPAN class="punctuation token">.</SPAN>TaskStatusCompleted<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//SNIP OUT ALL THE CODE ABOVE TO MAKE SHORTER</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// Results are from Feature Layer</SPAN>
<SPAN class="comment token">// iterate through individual features of the feature Layer results</SPAN>
<SPAN class="keyword token">for</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> f <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN> f <SPAN class="operator token"><</SPAN> identifyLayerResult<SPAN class="punctuation token">.</SPAN>popups<SPAN class="punctuation token">.</SPAN>length<SPAN class="punctuation token">;</SPAN> f<SPAN class="operator token">++</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
popup <SPAN class="operator token">=</SPAN> identifyLayerResult<SPAN class="punctuation token">.</SPAN>popups<SPAN class="punctuation token">[</SPAN>f<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
selectedFeature <SPAN class="operator token">=</SPAN> popup<SPAN class="punctuation token">.</SPAN>geoElement<SPAN class="punctuation token">;</SPAN>
popupDef <SPAN class="operator token">=</SPAN> popup<SPAN class="punctuation token">.</SPAN>popupDefinition<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Appending the result to the model </SPAN>
newPopup <SPAN class="operator token">=</SPAN> ArcGISRuntimeEnvironment<SPAN class="punctuation token">.</SPAN><SPAN class="token function">createObject</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Popup"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
initGeoElement<SPAN class="punctuation token">:</SPAN> selectedFeature<SPAN class="punctuation token">,</SPAN>
initPopupDefinition<SPAN class="punctuation token">:</SPAN> popupDef
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// create a popup manager</SPAN>
newPopupManager <SPAN class="operator token">=</SPAN> ArcGISRuntimeEnvironment<SPAN class="punctuation token">.</SPAN><SPAN class="token function">createObject</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"PopupManager"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>popup<SPAN class="punctuation token">:</SPAN> newPopup<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
popupListModel<SPAN class="punctuation token">.</SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'popupManager'</SPAN><SPAN class="punctuation token">:</SPAN> newPopupManager<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<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><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I updated the MAP section to this
Map<SPAN class="punctuation token">{</SPAN>
initUrl<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"http://arcgis.com/sharing/rest/content/items/8ccfcc3a83d241ce9765ff4aea459617"</SPAN>
<SPAN class="comment token">//initUrl: "https://vafwisdev.dgif.virginia.gov/arcgis/rest/services/DGIF_Test/BoatRampFacilities/FeatureServer/0"</SPAN>
FeatureLayer <SPAN class="punctuation token">{</SPAN>
ServiceFeatureTable <SPAN class="punctuation token">{</SPAN>
url<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0"</SPAN>
<SPAN class="comment token">//featureRequestMode: Enums.FeatureRequestModeOnInteractionNoCache</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
onLoadErrorChanged<SPAN class="punctuation token">:</SPAN><SPAN class="punctuation token">{</SPAN>
console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">log</SPAN><SPAN class="punctuation token">(</SPAN>mapView<SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>loadError<SPAN class="punctuation token">.</SPAN>additionalMessage<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><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>