<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting pics with push function. in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1176894#M6267</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I would like to know if it's possible to get a pic(image) instead the bus line?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Sadly, not in the way you want.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ideally, you would do something like this in the Arcade expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// this does not work!
Push(
    out_arr,
    `&amp;lt;img src="https://url.fr/images/line${f.ligne}.png"&amp;gt; vers ${f.destination}...`
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in the classic Map Viewer, Arcade expressions escape the HTML commands, so they get shown as text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you limit it to show only one arrival/departure, you can do it like you do for the images above: Use an Arcade expression to return an image url and use that url in the HTML code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Also, it is possible to sort the values on a push function?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Well, your sort does work, but it sorts the array alphabetically, and so it sorts first by line, then by destination, and only then by time. To change this behavior, you can use the optional &lt;STRONG&gt;comparatorFunction&lt;/STRONG&gt; argument (&lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#sort" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function sort_by_time(a, b) {
    var time_a = Split(a, " ")[-1]
    var time_b = Split(b, " ")[-1]
    if(time_a &amp;lt; time_b) {return -1}
    if(time_a &amp;gt; time_b) {return 1}
    return 0
}

var out_arr = [
    "Lianes 15 vers Courrejean 09:57:07",
    "Lianes 15 vers Pont De La Maye 09:51:45",
    ]
out_arr = Sort(out_arr, sort_by_time)
Concatenate(out_arr, "\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Lianes 15 vers Pont De La Maye 09:51:45
Lianes 15 vers Courrejean 09:57:07&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Out of interest: Your screenshot is only halfway through the HTML and you're at expression 135. How fast is the popup loading?&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 16:12:46 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-05-24T16:12:46Z</dc:date>
    <item>
      <title>Getting pics with push function.</title>
      <link>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1176746#M6265</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i 'll trying to get time stops whern the user click on a bus stop. It works like a charm but I would like a pic instead the name of the bus line.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 228px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42011i4426A73F9FB8E3C3/image-dimensions/228x249?v=v2" width="228" height="249" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To get this, i use the push function and I mix it with html.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 226px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42012i7D3072719EF6AFE2/image-dimensions/226x170?v=v2" width="226" height="170" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.PNG" style="width: 265px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42013i84054D5F852DDCED/image-dimensions/265x178?v=v2" width="265" height="178" role="button" title="Capture3.PNG" alt="Capture3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to know if it's possible to get a pic(image) instead the bus line? I tried with a string and the value but it doesn't work.&lt;/P&gt;&lt;P&gt;Also, it is possible to sort the values on a push function? I would like to sort the times stops and I don't know how to do, the sort I made doesn't work like I want.&lt;/P&gt;&lt;P&gt;Thank you everybody!&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 08:07:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1176746#M6265</guid>
      <dc:creator>KARIMLABIDI</dc:creator>
      <dc:date>2022-05-24T08:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting pics with push function.</title>
      <link>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1176894#M6267</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I would like to know if it's possible to get a pic(image) instead the bus line?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Sadly, not in the way you want.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ideally, you would do something like this in the Arcade expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// this does not work!
Push(
    out_arr,
    `&amp;lt;img src="https://url.fr/images/line${f.ligne}.png"&amp;gt; vers ${f.destination}...`
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in the classic Map Viewer, Arcade expressions escape the HTML commands, so they get shown as text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you limit it to show only one arrival/departure, you can do it like you do for the images above: Use an Arcade expression to return an image url and use that url in the HTML code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Also, it is possible to sort the values on a push function?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Well, your sort does work, but it sorts the array alphabetically, and so it sorts first by line, then by destination, and only then by time. To change this behavior, you can use the optional &lt;STRONG&gt;comparatorFunction&lt;/STRONG&gt; argument (&lt;A href="https://developers.arcgis.com/arcade/function-reference/data_functions/#sort" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function sort_by_time(a, b) {
    var time_a = Split(a, " ")[-1]
    var time_b = Split(b, " ")[-1]
    if(time_a &amp;lt; time_b) {return -1}
    if(time_a &amp;gt; time_b) {return 1}
    return 0
}

var out_arr = [
    "Lianes 15 vers Courrejean 09:57:07",
    "Lianes 15 vers Pont De La Maye 09:51:45",
    ]
out_arr = Sort(out_arr, sort_by_time)
Concatenate(out_arr, "\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Lianes 15 vers Pont De La Maye 09:51:45
Lianes 15 vers Courrejean 09:57:07&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Out of interest: Your screenshot is only halfway through the HTML and you're at expression 135. How fast is the popup loading?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 16:12:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1176894#M6267</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-24T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting pics with push function.</title>
      <link>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1177125#M6268</link>
      <description>&lt;P&gt;Thank you Johannes. The sort work perfectly!&lt;/P&gt;&lt;P&gt;Too bad pour the pics, it is not&amp;nbsp; possible because sometimes I can have 2 and more lines.&lt;/P&gt;&lt;P&gt;For the pop up, it's quit fast for me! As you see,each line got his pic and I had to create a arcade script for each. And I added other pics like the transport mode or the accessibility. So more and more...But I think It's pretty quick. For me, what slows down the pop up is all geographic work (shortest distance,...).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KARIMLABIDI_0-1653464472212.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42120iDCFF9AAF36F048A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KARIMLABIDI_0-1653464472212.png" alt="KARIMLABIDI_0-1653464472212.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 07:47:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/getting-pics-with-push-function/m-p/1177125#M6268</guid>
      <dc:creator>KARIMLABIDI</dc:creator>
      <dc:date>2022-05-25T07:47:02Z</dc:date>
    </item>
  </channel>
</rss>

