<?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: Custom map's infoTemplate in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-map-s-infotemplate/m-p/1160561#M76909</link>
    <description>&lt;P&gt;OK. I will answer myself. If anyone has a better answer and wants to add it, thanks in advance:&lt;/P&gt;&lt;P&gt;My solution will be to modify the Splash widget, which is a widget that starts at the beginning of the app, in such a way that in the "start" event of the widget I will do the following:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var url = "captured url of the service of interest"
        this.map.on("layer-add-result", function(evt){
          if(evt.layer.url == url){
            var titulo = "Información de " + evt.layer.name;
            var infoTemplate = new InfoTemplate(titulo, function(graphic){
              var content = "";
              for(var i=0; i&amp;lt;evt.layer.fields.length; i++){
                if(evt.layer.fields[i].name == "URL"){
                  content = content + "&amp;lt;br&amp;gt;&amp;lt;a href="+ graphic.attributes[evt.layer.fields[i].name] + graphic.attributes["sesion"] target='_blank'&amp;gt;Más información del objeto&amp;lt;/a&amp;gt;"
                }
                else{
                  content = content + "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;" + evt.layer.fields[i].name + "&amp;lt;/b&amp;gt;: " + graphic.attributes[evt.layer.fields[i].name]
                }
              }
              return content;
            });
            evt.layer.setInfoTemplate(infoTemplate);
          }
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Apr 2022 23:36:06 GMT</pubDate>
    <dc:creator>GeoGarage</dc:creator>
    <dc:date>2022-04-02T23:36:06Z</dc:date>
    <item>
      <title>Custom map's infoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-map-s-infotemplate/m-p/1160490#M76903</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I am developping with API 3.35 and wab 2.19. It is not possible for me to change of versions for client requeriments.&lt;/P&gt;&lt;P&gt;I need customize the map's default infoTemplate, and it's not possible customized for a particular layer or several layers. If I were to customize the infoTemplate of several layers, then I would be forced to preload them, and the workflow doesn'y allow this.&lt;/P&gt;&lt;P&gt;I need to reached the default infoTemplate of the map for customize its infoTemplate.content property in such a way when I click on a feature, if an of its fields has a certain value type, then the value is reclaculated, showing the new value in the infoWindow. If the feature (or layer) doesn't have this field type, then infoTemplate is without customization.&lt;/P&gt;&lt;P&gt;The service is a DynamicMapServiceLayer, consecuently it is not possible to customize infoTemplate in portal, as in the case of a FeatureService.&lt;/P&gt;&lt;P&gt;Is it possible to reached the map's default infoTemplate for customize it?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 22:48:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-map-s-infotemplate/m-p/1160490#M76903</guid>
      <dc:creator>GeoGarage</dc:creator>
      <dc:date>2022-04-01T22:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom map's infoTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-map-s-infotemplate/m-p/1160561#M76909</link>
      <description>&lt;P&gt;OK. I will answer myself. If anyone has a better answer and wants to add it, thanks in advance:&lt;/P&gt;&lt;P&gt;My solution will be to modify the Splash widget, which is a widget that starts at the beginning of the app, in such a way that in the "start" event of the widget I will do the following:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var url = "captured url of the service of interest"
        this.map.on("layer-add-result", function(evt){
          if(evt.layer.url == url){
            var titulo = "Información de " + evt.layer.name;
            var infoTemplate = new InfoTemplate(titulo, function(graphic){
              var content = "";
              for(var i=0; i&amp;lt;evt.layer.fields.length; i++){
                if(evt.layer.fields[i].name == "URL"){
                  content = content + "&amp;lt;br&amp;gt;&amp;lt;a href="+ graphic.attributes[evt.layer.fields[i].name] + graphic.attributes["sesion"] target='_blank'&amp;gt;Más información del objeto&amp;lt;/a&amp;gt;"
                }
                else{
                  content = content + "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;" + evt.layer.fields[i].name + "&amp;lt;/b&amp;gt;: " + graphic.attributes[evt.layer.fields[i].name]
                }
              }
              return content;
            });
            evt.layer.setInfoTemplate(infoTemplate);
          }
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2022 23:36:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-map-s-infotemplate/m-p/1160561#M76909</guid>
      <dc:creator>GeoGarage</dc:creator>
      <dc:date>2022-04-02T23:36:06Z</dc:date>
    </item>
  </channel>
</rss>

