<?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: graphics not showing for featureLayer in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862150#M11895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for your reply.&amp;nbsp; I think I have that straightened out.&amp;nbsp; Below is my updated code, but I still get the same results.&amp;nbsp; Operational layer added to attribute table, but 'zoom to' the feature just shows a selection, but no symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also below is a screen shot showing the features in the attribute table and how you can zoom to a feature, but the maps only shows the selection rectangle, and attached is the FeatureLayer from Dev tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 8,
&amp;nbsp; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp; new Color([255, 0, 0]), 1),
&amp;nbsp; new Color([0, 255, 0, 0.25]));

var layerInfo = {
&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp; 'objectIdField' : '__OBJECTID',
&amp;nbsp; "drawingInfo": {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "renderer": {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "type": "simple",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Call",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "description" : "Call",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "symbol": symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; },
&amp;nbsp; 'type' : 'Feature Layer',
&amp;nbsp; 'typeIdField' : '',
&amp;nbsp; '_titleForLegend': 'Calls for Service',
&amp;nbsp; 'defaultVisibility': true,
&amp;nbsp; 'displayField': 'call_type',
&amp;nbsp; 'name': 'Calls For Service',
&amp;nbsp; 'fields': fields,
&amp;nbsp; 'types' : [],
&amp;nbsp; 'capabilities' : 'Map,Query,Data'
};
this.callsFeatureCollection = {
&amp;nbsp; 'layerDefinition' : layerInfo,
&amp;nbsp; 'featureSet' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'features' : this.features,
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'spatialReference' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'wkid' : 3857
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
};
this.callsFeatureLayer = new FeatureLayer(this.callsFeatureCollection, {
&amp;nbsp; id: 'CallsForService',
});
this.map.addLayer(this.callsFeatureLayer);
},


&amp;nbsp;&amp;nbsp;&amp;nbsp; //after adding features to this.features, I add them to the featureLayer if they were successfully geocoded (contain geometry)&amp;nbsp; 
_drawResults: function () {&amp;nbsp; 
&amp;nbsp; for (var i = 0, len = this.features.length; i &amp;lt; len; i++) {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.features&lt;I&gt;.geometry) {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.callsFeatureLayer.add(this.features&lt;I&gt;);&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; 
&amp;nbsp; }&amp;nbsp; 
&amp;nbsp; this.callsFeatureLayer.refresh();
&amp;nbsp; this.callsFeatureLayer.redraw();&amp;nbsp; 
}&lt;/I&gt;&lt;/I&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="att table selected feature.png" class="image-1 jive-image" src="/legacyfs/online/188266_att table selected feature.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 10:41:43 GMT</pubDate>
    <dc:creator>SebastianRoberts</dc:creator>
    <dc:date>2021-12-12T10:41:43Z</dc:date>
    <item>
      <title>graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862148#M11893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a featureLayer that I have added to the map, and when I open the attribute table, the features show in the table, and I can select and zoom to the individual features through the attribute table interface, but I'm not able to get the features to actually draw on the map.&amp;nbsp; Anyone willing to take a look at my code to see what I'm missing?&lt;/P&gt;&lt;P&gt;I didn't include the portion where the features are created, but I think since I am able to see the attributes in the table, and zoom to each of the features using the Attribute table, I am doing that part correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//the relevant part of the postCreate function
 postCreate: function () {
&amp;nbsp; var layerInfo = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'objectIdField' : '__OBJECTID',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'type' : 'Feature Layer',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'typeIdField' : '',
&amp;nbsp;&amp;nbsp;&amp;nbsp; '_titleForLegend': 'Calls for Service',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'defaultVisibility': true,
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'displayField': 'call_type',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'name': 'Calls For Service',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'fields': this.fields,
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'types' : [],
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'capabilities' : 'Map,Query'
&amp;nbsp; };
&amp;nbsp; this.callsFeatureCollection = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'layerDefinition' : layerInfo,
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'featureSet' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'features' : this.features,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'spatialReference' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'wkid' : 3857
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; };
&amp;nbsp; this.callsFeatureLayer = new FeatureLayer(this.callsFeatureCollection);
&amp;nbsp; var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 8,
&amp;nbsp;&amp;nbsp;&amp;nbsp; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([255, 0, 0]), 1),
&amp;nbsp;&amp;nbsp;&amp;nbsp; new Color([0, 255, 0, 0.25]));
&amp;nbsp; var renderer = new SimpleRenderer(symbol);
&amp;nbsp; this.callsFeatureLayer.setRenderer(renderer);
&amp;nbsp; this.map.addLayer(this.callsFeatureLayer, {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate : this.infoTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id : 'CallsForService',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name : 'Calls For Service'
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
}
//after adding features to this.features, I add them to the featureLayer if they were successfully geocode (contain geometry) 
 _drawResults: function () {
&amp;nbsp;&amp;nbsp; for (var i = 0, len = this.features.length; i &amp;lt; len; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.features&lt;I&gt;.geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.callsFeatureLayer.add(this.features&lt;I&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
this.callsFeatureLayer.refresh();
this.callsFeatureLayer.add(feature); 
}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862148#M11893</guid>
      <dc:creator>SebastianRoberts</dc:creator>
      <dc:date>2021-12-12T10:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862149#M11894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sebastian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maps addLayer method takes a layer object and an optional index as parameters. You seem to be passing an object with infoTemplate, id and name as the second parameter. I think you need to fix that and see what happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 14:13:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862149#M11894</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-02-29T14:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862150#M11895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for your reply.&amp;nbsp; I think I have that straightened out.&amp;nbsp; Below is my updated code, but I still get the same results.&amp;nbsp; Operational layer added to attribute table, but 'zoom to' the feature just shows a selection, but no symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also below is a screen shot showing the features in the attribute table and how you can zoom to a feature, but the maps only shows the selection rectangle, and attached is the FeatureLayer from Dev tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 8,
&amp;nbsp; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
&amp;nbsp; new Color([255, 0, 0]), 1),
&amp;nbsp; new Color([0, 255, 0, 0.25]));

var layerInfo = {
&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp; 'objectIdField' : '__OBJECTID',
&amp;nbsp; "drawingInfo": {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "renderer": {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "type": "simple",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Call",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "description" : "Call",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "symbol": symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; },
&amp;nbsp; 'type' : 'Feature Layer',
&amp;nbsp; 'typeIdField' : '',
&amp;nbsp; '_titleForLegend': 'Calls for Service',
&amp;nbsp; 'defaultVisibility': true,
&amp;nbsp; 'displayField': 'call_type',
&amp;nbsp; 'name': 'Calls For Service',
&amp;nbsp; 'fields': fields,
&amp;nbsp; 'types' : [],
&amp;nbsp; 'capabilities' : 'Map,Query,Data'
};
this.callsFeatureCollection = {
&amp;nbsp; 'layerDefinition' : layerInfo,
&amp;nbsp; 'featureSet' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'features' : this.features,
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'geometryType' : 'esriGeometryPoint',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'spatialReference' : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'wkid' : 3857
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
};
this.callsFeatureLayer = new FeatureLayer(this.callsFeatureCollection, {
&amp;nbsp; id: 'CallsForService',
});
this.map.addLayer(this.callsFeatureLayer);
},


&amp;nbsp;&amp;nbsp;&amp;nbsp; //after adding features to this.features, I add them to the featureLayer if they were successfully geocoded (contain geometry)&amp;nbsp; 
_drawResults: function () {&amp;nbsp; 
&amp;nbsp; for (var i = 0, len = this.features.length; i &amp;lt; len; i++) {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.features&lt;I&gt;.geometry) {&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.callsFeatureLayer.add(this.features&lt;I&gt;);&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; 
&amp;nbsp; }&amp;nbsp; 
&amp;nbsp; this.callsFeatureLayer.refresh();
&amp;nbsp; this.callsFeatureLayer.redraw();&amp;nbsp; 
}&lt;/I&gt;&lt;/I&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="att table selected feature.png" class="image-1 jive-image" src="/legacyfs/online/188266_att table selected feature.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862150#M11895</guid>
      <dc:creator>SebastianRoberts</dc:creator>
      <dc:date>2021-12-12T10:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862151#M11896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a link to the a sample with some fictitious data if anyone is willing to take a look.&amp;nbsp; Just click the "submit" button on the "Calls For Service" widget that opens at start.&amp;nbsp; The calls are geocoded, added to the list, and added to the Layer List as an operational layer, from which you can open the attribute table.&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.nevcounty.net/test/wab01/"&gt;http://gis.nevcounty.net/test/wab01/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Test in Chrome, IE is still choking on a date function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/188318_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862151#M11896</guid>
      <dc:creator>SebastianRoberts</dc:creator>
      <dc:date>2016-03-01T18:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862152#M11897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sebastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have found working with FeatureLayers coming from a collection that I have to add the symbol to each graphic. The Renderer will not work by itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;feature.setSymbol(yourSymbol);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:42:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862152#M11897</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-03-01T18:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: graphics not showing for featureLayer</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862153#M11898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&amp;nbsp; That led me to the solution.&amp;nbsp; I did something wrong with the way that I created my features.&amp;nbsp; I am geocoding, and tried to build&amp;nbsp; features from the&amp;nbsp; candidates that are returned.&amp;nbsp; My feature did not have a setSymbol method.&amp;nbsp; I created a new graphic instead and added that to the featureLayer , and it is working now.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 23:32:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/graphics-not-showing-for-featurelayer/m-p/862153#M11898</guid>
      <dc:creator>SebastianRoberts</dc:creator>
      <dc:date>2016-03-01T23:32:16Z</dc:date>
    </item>
  </channel>
</rss>

