<?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 how to have an Infotemplate/popup with move/next button to navigate to all the attributes? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-have-an-infotemplate-popup-with-move-next/m-p/1108891#M75014</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to have a move next/previous button in infotemplate/popup to navigate to the different attributes of a single feature.&amp;nbsp; I have attached sample code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Chitra&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; _createBlockLayerMoveNext: function (defExpression, renderer) {                                  

            this.blocklyr = new GraphicsLayer({ id: 'blocklyr' });
            var grps = [];
            var url = "https://services8.arcgis.com/HPJsu0I9OjNDnQ7I/arcgis/rest/services/tl_2020_42_tabblock20/FeatureServer/0";            

            var blockGroupsLyr = new FeatureLayer(url, {
                outFields: ['*']
            });

            var queryParams = new query();
            queryParams.outFields = ['*'];
            queryParams.geometry = this.map.extent;
            queryParams.spatialRel = "intersects";

            blockGroupsLyr.queryFeatures(queryParams)

                .then((results) =&amp;gt; {

                    results.features.map(function (feature) {                     

                        var ply = new Polygon({
                            rings: feature.geometry.rings,
                            spatialReference: feature.geometry.spatialReference
                        });

                        var pictureMarkerSymbol = new PictureMarkerSymbol('app/widgets/DataLayers/images/Assisting-Prostitution.png', 25, 25);

                        var infoTemplate = new InfoTemplate();
                        infoTemplate.setTitle("&amp;lt;b&amp;gt;Block-" + feature.attributes.BLOCKCE20 + "&amp;lt;br/&amp;gt;");
                        infoTemplate.setContent("&amp;lt;b&amp;gt;" + feature.attributes.BLOCKCE20 + "&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;");

                        for (i = 0; i &amp;lt; feature.attributes.length; i++) {

                            //loop through the attributes and add to infotemplate like a next/previous button                        
                        }
                       
                        var newppin = new Point(ply.getCentroid().x, ply.getCentroid().y,
                            new SpatialReference({ wkid: 3857 })
                        );
                        grps.push(new Graphic(newppin, pictureMarkerSymbol).setInfoTemplate(infoTemplate));
                    });

                    this.blocklyr.clear();
                    array.forEach(grps, lang.hitch(this, function (g) {
                        this.blocklyr.add(g);
                    }));
                    
                    this.map.addLayer(this.blocklyr);
                })   
                .then(response =&amp;gt; {
                    this._shelter.hide();
                })
                .otherwise((error) =&amp;gt; {
                    console.log(error.error);
                });
            
        },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 16:06:40 GMT</pubDate>
    <dc:creator>ChitraKrishnan</dc:creator>
    <dc:date>2021-10-19T16:06:40Z</dc:date>
    <item>
      <title>how to have an Infotemplate/popup with move/next button to navigate to all the attributes?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-have-an-infotemplate-popup-with-move-next/m-p/1108891#M75014</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to have a move next/previous button in infotemplate/popup to navigate to the different attributes of a single feature.&amp;nbsp; I have attached sample code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Chitra&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; _createBlockLayerMoveNext: function (defExpression, renderer) {                                  

            this.blocklyr = new GraphicsLayer({ id: 'blocklyr' });
            var grps = [];
            var url = "https://services8.arcgis.com/HPJsu0I9OjNDnQ7I/arcgis/rest/services/tl_2020_42_tabblock20/FeatureServer/0";            

            var blockGroupsLyr = new FeatureLayer(url, {
                outFields: ['*']
            });

            var queryParams = new query();
            queryParams.outFields = ['*'];
            queryParams.geometry = this.map.extent;
            queryParams.spatialRel = "intersects";

            blockGroupsLyr.queryFeatures(queryParams)

                .then((results) =&amp;gt; {

                    results.features.map(function (feature) {                     

                        var ply = new Polygon({
                            rings: feature.geometry.rings,
                            spatialReference: feature.geometry.spatialReference
                        });

                        var pictureMarkerSymbol = new PictureMarkerSymbol('app/widgets/DataLayers/images/Assisting-Prostitution.png', 25, 25);

                        var infoTemplate = new InfoTemplate();
                        infoTemplate.setTitle("&amp;lt;b&amp;gt;Block-" + feature.attributes.BLOCKCE20 + "&amp;lt;br/&amp;gt;");
                        infoTemplate.setContent("&amp;lt;b&amp;gt;" + feature.attributes.BLOCKCE20 + "&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;");

                        for (i = 0; i &amp;lt; feature.attributes.length; i++) {

                            //loop through the attributes and add to infotemplate like a next/previous button                        
                        }
                       
                        var newppin = new Point(ply.getCentroid().x, ply.getCentroid().y,
                            new SpatialReference({ wkid: 3857 })
                        );
                        grps.push(new Graphic(newppin, pictureMarkerSymbol).setInfoTemplate(infoTemplate));
                    });

                    this.blocklyr.clear();
                    array.forEach(grps, lang.hitch(this, function (g) {
                        this.blocklyr.add(g);
                    }));
                    
                    this.map.addLayer(this.blocklyr);
                })   
                .then(response =&amp;gt; {
                    this._shelter.hide();
                })
                .otherwise((error) =&amp;gt; {
                    console.log(error.error);
                });
            
        },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 16:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-have-an-infotemplate-popup-with-move-next/m-p/1108891#M75014</guid>
      <dc:creator>ChitraKrishnan</dc:creator>
      <dc:date>2021-10-19T16:06:40Z</dc:date>
    </item>
  </channel>
</rss>

