Good Afternoon,
I was just wondering if it is possible via JS to get a layers popup information? I was hoping to just grab the info and send it to another widget.
Any help is greatly appreciated.
Mark
I don't believe this is possible when working from within the WAB framework of Portal. You would likely need to use the developer edition of WAB if you're not using it already.
I am using the Developer version of WAB.
Mark,
In JS the way you get the current popup info is:
<SPAN class="keyword token">var</SPAN> atts <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>infoWindow<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getSelectedFeature</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Thanks Rob.
I gather I will need some type of handler to listen to the map for when a feature is selected? Using on click doesn't seem right since it would fire where ever the user clicks on the map. =]
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.