<?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: Refreshing Feature Layer after changing source graphics in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645592#M60179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show some code to indicate how you are handling the pan event and setting the Feature Layer source?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 09:59:31 GMT</pubDate>
    <dc:creator>FC_Basson</dc:creator>
    <dc:date>2017-01-19T09:59:31Z</dc:date>
    <item>
      <title>Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645591#M60178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Feature Layer on a MapView and I am to implement lazy loading of items to display on the map. So items only get returned from the server if their location lies in the extent of the map. I need a way to replace the source graphics with a new one when the user pans the map. I have tried the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Changing the source property of the map and calling layer.refresh(). The properties are updated but graphics are not visible, only those from the initial load.&lt;/P&gt;&lt;P&gt;2. Creating a new layer entirely and removing the existing layer - the same effect as (1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am listening to the &amp;nbsp;view.extent property and chaining the events to an rxjs subject (which is later subscribed to &amp;nbsp;by an observable, debouncing to ensure that it doesnt get swamped with requests).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;self.view.watch("extent", function(extent){&lt;BR /&gt; self.extentTerms.next(extent);&lt;BR /&gt; })&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the items are generated, I call the generateGraphics method and generateLayers method&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private generateGraphics(donors: Donor[]){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; console.log('donors in extent');&lt;BR /&gt;&amp;nbsp; &amp;nbsp; console.log(donors);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return donors.map((donor) =&amp;gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; geometry: new Point({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x: ...,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y: ..&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}),&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;attributes: {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;id:. ...,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;email: ....,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;phone: ....,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;....&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private generateLayer(graphics: any): any{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(graphics);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(this.layer){&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this._mapService.map.remove(this.layer);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.layer.source = graphics;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(this.layer);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this._mapService.map.add(this.layer);&lt;BR /&gt; }else{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.layer = new FeatureLayer({&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;source: graphics,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fields: FIELDS,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objectIdField: "id",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;renderer: donorMapRenderer,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;spatialReference: {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wkid: 4326&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;geometryType: "point",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;popupTemplate: P_TEMPLATE,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;elevationInfo: { mode: "absolute-height" }&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this._mapService.map.add(this.layer);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; console.log("returning");&lt;BR /&gt; return this.view;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;How do I achieve this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 07:09:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645591#M60178</guid>
      <dc:creator>GeraldOyudo</dc:creator>
      <dc:date>2017-01-19T07:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645592#M60179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show some code to indicate how you are handling the pan event and setting the Feature Layer source?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 09:59:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645592#M60179</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2017-01-19T09:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645593#M60180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have edited the post with a snippet of the code that creates the Feature layer. This is my first post, I apologize if the code is not so readable. I tried removing the layer if it existed here. In my previous attempt, I just changed the source property and called the refresh method. still nothing happened.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 10:51:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645593#M60180</guid>
      <dc:creator>GeraldOyudo</dc:creator>
      <dc:date>2017-01-19T10:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645594#M60181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Were you ever able to figure this out? I'm having the same issue - not able to update the graphic collection in my featurelayer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2017 23:44:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645594#M60181</guid>
      <dc:creator>TobySemroc</dc:creator>
      <dc:date>2017-12-01T23:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645595#M60182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Added in version 4.6:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Most layers now can be refreshed in &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html"&gt;2D MapViews&lt;/A&gt; by setting &lt;CODE&gt;refreshInterval&lt;/CODE&gt; property or by calling &lt;CODE&gt;refresh()&lt;/CODE&gt; method on it.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Dec 2017 21:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645595#M60182</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-12-14T21:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645596#M60183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using the applyEdits function on de layer worked for me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;layer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;applyEdits&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;addFeatures: [...graphics]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 07:29:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645596#M60183</guid>
      <dc:creator>MarcoFlier1</dc:creator>
      <dc:date>2019-08-01T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645597#M60184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refresh method refreshed the layer but pop up content not change if it's open(in arcgis API 4.13) and the feature is still visible on the map if it is deleted. So without reopening the popup how to update its content and remove feature from map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2020 06:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/645597#M60184</guid>
      <dc:creator>ShefaliMantri</dc:creator>
      <dc:date>2020-08-26T06:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing Feature Layer after changing source graphics</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/1108607#M75000</link>
      <description>&lt;P&gt;I created an empty feature class so that I could add it to my Legend once populated with my graphics layer that I create dynamically based on a user's filter selections.&amp;nbsp; My graphics features change, but what the map doesn't change; only the initial features display on the map.&amp;nbsp; How can I get my renderer to refresh, so to speak?&amp;nbsp; I tried layer.refresh(), but it doesn't do anything.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;           // renderer for feature class
           let rendererPoint = {
                type: "unique-value",  // autocasts as new UniqueValueRenderer()
                field: "TextColor",
                field2: "RequestRead",
                field3: "Completed",
                fieldDelimiter: ", ",  // comma + space used to separate values from all fields
                legendOptions: {
                    title: "RFI Requests"
                },
                defaultSymbol: {
                    type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
                    //color: "white", 
                    style: "circle",
                    size: "18px",
                    outline: {
                        // autocasts as new SimpleLineSymbol()
                        color: [255, 255, 0],  // yellow outline
                        width: 2
                    }
                },
                defaultLabel: "Completed",
                uniqueValueInfos: [{

                    // All features with value of "Red" are Urgent
                    value: "Red, False, False",
                    label: "Urgent (Unread)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#ff0040",
                        style: "square",
                        size: "14px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [0, 0, 0],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Green" are Contact Requested
                    value: "Green, False, False",
                    label: "Contact Requested (Unread)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#7fff00",
                        style: "square",
                        size: "14px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [0, 0, 0],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Normal" are Normal
                    value: "Black, False, False",
                    label: "Normal (Unread)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#0000e6", // blue
                        style: "square",
                        size: "14px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [0, 0, 0],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Red" are Urgent
                    value: "Red, True, False",
                    label: "Urgent (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#ff0040",
                        style: "diamond",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 255],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Green" are Contact Requested
                    value: "Green, True, False",
                    label: "Contact Requested (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#7fff00",
                        style: "diamond",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 255],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Normal" are Normal
                    value: "Black, True, False",
                    label: "Normal (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#0000e6", // blue
                        style: "diamond",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 255],
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Red" are Urgent
                    value: "Red, True, True",
                    label: "Urgent (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#ff0040",
                        style: "circle",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 0],   // yellow outline
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Green" are Contact Requested
                    value: "Green, True, True",
                    label: "Contact Requested (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#7fff00",
                        style: "circle",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 0],   // yellow outline
                            width: 2
                        }
                    }
                }, {
                    // All features with value of "Normal" are Normal
                    value: "Black, True, True",
                    label: "Normal (Read)",
                    symbol: {
                        type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                        color: "#0000e6", // blue
                        style: "circle",
                        size: "18px",
                        outline: {
                            // autocasts as new SimpleLineSymbol()
                            color: [255, 255, 0],  // yellow outline
                            width: 2
                        }
                    }
                }]
            };

            // create empty FeatureLayer
            let lyrRFIRequests = new FeatureLayer({
                // create an instance of esri/layers/support/Field for each field object
                title: "RFI Requests",
                fields: [
                    {
                        name: "OBJECTID",
                        alias: "ObjectID",
                        type: "oid"
                    },
                    {
                        name: "RequestID",
                        alias: "RequestID",
                        type: "string"
                    },
                    {
                        name: "RequestType",
                        alias: "RequestType",
                        type: "string"
                    },
                    {
                        name: "ReceivedDate",
                        alias: "ReceivedDate",
                        type: "string"
                    },
                    {
                        name: "RoutedTo",
                        alias: "RoutedTo",
                        type: "string"
                    },
                    {
                        name: "TextColor",
                        alias: "TextColor",
                        type: "string"
                    },
                    {
                        name: "RequestRead",
                        alias: "RequestRead",
                        type: "string"
                    },
                    {
                        name: "Completed",
                        alias: "Completed",
                        type: "string"
                    }
                ],
                objectIdField: "OBJECTID",
                geometryType: "point",
                spatialReference: { wkid: 3857 },
                //source: graphicsLayerRFIRequests.graphics,
                renderer: rendererPoint,
                popupTemplate: {
                    // autocasts as new PopupTemplate()
                    title: "RFI Request ID: {RequestID}",
                    content: "&amp;lt;b&amp;gt;Received Date:&amp;lt;/b&amp;gt; {ReceivedDate}" +
                        "&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Routed To:&amp;lt;/b&amp;gt; {RoutedTo}" +
                        "&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Request Type:&amp;lt;/b&amp;gt; {RequestType}",
                    actions: [lookupRFIAction]
                }
            });

            //function that creates graphic point
            function plotRFIpoints(paramItem, paramRecCount) {
                var rec = paramItem.split("||");
                var requestsPoint = {
                    type: "point", // autocasts as new Point()
                    x: parseFloat(rec[16]),
                    y: parseFloat(rec[15]),
                    spatialReference: new SpatialReference({ wkid: 3857 })
                };

                var myRequestID = rec[0].toString();
                var myCompletedDate = rec[8];
                var myReceivedDate = "";
                if (rec[5].length !== 0) {
                    myReceivedDate = rec[5].toString();
                }

                var myAttributes = {
                    "ObjectID": paramRecCount,
                    "RequestID": myRequestID,
                    "RequestType": rec[2],
                    "ReceivedDate": myReceivedDate,
                    "RoutedTo": rec[11],
                    "TextColor": rec[13],
                    "RequestRead": rec[14],
                    "Completed": "False"
                }

                // if completed, set outline to yellow and shape to round
                if (myCompletedDate.length !== 0) {
                    myAttributes.Completed = "True";
                }

                // Create a graphic and add the geometry and symbol to it
                var pointGraphicRequests = new Graphic({
                    geometry: requestsPoint,
                    //symbol: markerSymbolRequests,
                    attributes: myAttributes,
                    popupTemplate: {
                        // autocasts as new PopupTemplate()
                        title: "RFI Request ID: {RequestID}",
                        content: "&amp;lt;b&amp;gt;Received Date:&amp;lt;/b&amp;gt; {ReceivedDate}" +
                            "&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Routed To:&amp;lt;/b&amp;gt; {RoutedTo}" +
                            "&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;Request Type:&amp;lt;/b&amp;gt; {RequestType}",
                        actions: [lookupRFIAction]
                    }
                });       
                graphicsLayerRFIRequests.add(pointGraphicRequests);
            } // end function plotRFIpoints()

// after all the points are plotted using the plotRFIpoints() function, then
// reset layer source and refresh
lyrRFIRequests.source = graphicsLayerRFIRequests.graphics;
lyrRFIRequests.refresh();
map.remove(lyrRFIRequests);
map.add(lyrRFIRequests);&lt;/LI-CODE&gt;&lt;P&gt;lyrRFIRequests.source = graphicsLayerRFIRequests.graphics;&lt;BR /&gt;lyrRFIRequests.refresh();&lt;BR /&gt;map.remove(lyrRFIRequests);&lt;BR /&gt;map.add(lyrRFIRequests);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 21:27:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refreshing-feature-layer-after-changing-source/m-p/1108607#M75000</guid>
      <dc:creator>LoriMcCormack1</dc:creator>
      <dc:date>2021-10-18T21:27:21Z</dc:date>
    </item>
  </channel>
</rss>

