<?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: Smart Mapping - Relationship Renderer 3.28 Error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72286#M6523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually it is my bad. I copied and pasted wrong code snippets from different places while i am trying to post this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code in the original post is updated now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2019 15:24:06 GMT</pubDate>
    <dc:creator>SabriGhaith</dc:creator>
    <dc:date>2019-04-04T15:24:06Z</dc:date>
    <item>
      <title>Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72284#M6521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement &lt;A href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=renderer_relationship"&gt;this &lt;/A&gt;sample on my own local WAB by creating a custom widget and restructure the functions and HTML as per widget standards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i used to implement different samples, and i believe it is not about something wrong with my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when the widget opened, the user have to provide necessary inputs so the smart mapping object shall work properly as the sample in the above link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code code is working perfectly until it reaches to the point below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Creates the predominance renderer&lt;BR /&gt; smartMapping.createRelationshipRenderer(relationshipParams).then(this.applyRenderer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the console log below error:&lt;/P&gt;&lt;P&gt;init.js:115 "&lt;STRONG&gt;Error: smartMapping.createRelationshipRenderer: B.getClassValuesForRelationship is not a function&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually cannot find any documentation for&amp;nbsp;&lt;STRONG&gt;getClassValuesForRelationship&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why i am getting that error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Helpful notes&lt;/STRONG&gt;: The WAB i am working on is created by Portal for ArcGIS 10.6.1 and downloaded to be extended. It is hosted on IIS and the API version used in this app is 3.28 from CDN "https://js.arcgis.com".&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;define(['dojo/_base/declare',&lt;BR /&gt; 'dojo/_base/html',&lt;BR /&gt; 'dojo/query',&lt;BR /&gt; 'dojo/on',&lt;BR /&gt; 'dojo/_base/lang',&lt;BR /&gt; 'dijit/_WidgetsInTemplateMixin',&lt;BR /&gt; 'jimu/BaseWidget',&lt;BR /&gt; "dojo/_base/array",&lt;BR /&gt; "dojo/dom",&lt;BR /&gt; "dojo/number",&lt;BR /&gt; "esri/basemaps",&lt;BR /&gt; "esri/Color",&lt;BR /&gt; "esri/dijit/Basemap",&lt;BR /&gt; "esri/dijit/BasemapGallery",&lt;BR /&gt; "esri/layers/FeatureLayer",&lt;BR /&gt; "esri/map",&lt;BR /&gt; "esri/renderers/smartMapping",&lt;BR /&gt; "esri/arcgis/utils",&lt;BR /&gt; "esri/styles/relationship",&lt;BR /&gt; "esri/dijit/Legend",&lt;BR /&gt; "esri/dijit/PopupTemplate",&lt;BR /&gt; "dojo/domReady!"&lt;BR /&gt;],&lt;BR /&gt; function (declare, html, query, on, lang, _WidgetsInTemplateMixin, BaseWidget, arrayUtil, dom, number,&lt;BR /&gt; esriBasemaps, Color, Basemap, BasemapGallery, FeatureLayer, Map, smartMapping, utils, relationshipStyles, Legend, PopupTemplate) {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; var relationshipParams;&lt;BR /&gt; var showDescriptiveLabelsElement;&lt;/P&gt;&lt;P&gt;var url = "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/Mexico_demographics/FeatureServer/0";&lt;/P&gt;&lt;P&gt;// Create new feature layer pointing to service with educational&lt;BR /&gt; // attainment data by city and assigns it a PopupTemplate&lt;/P&gt;&lt;P&gt;var layer = new FeatureLayer(url, {&lt;BR /&gt; outFields: ["NAME", "EDUC01_CY", "EDUCA_BASE", "AVGHHSZ_CY"],&lt;BR /&gt; infoTemplate: new PopupTemplate({&lt;BR /&gt; title: "{NAME}",&lt;BR /&gt; description: "{EDUC01_CY} people in this municipality didn't complete any formal education.",&lt;BR /&gt; fieldInfos: [{&lt;BR /&gt; fieldName: "EDUC01_CY",&lt;BR /&gt; label: "Population without formal education",&lt;BR /&gt; format: { places: 0, digitSeparator: true }&lt;BR /&gt; }, {&lt;BR /&gt; fieldName: "EDUCA_BASE",&lt;BR /&gt; label: "Total population"&lt;BR /&gt; }, {&lt;BR /&gt; fieldName: "AVGHHSZ_CY",&lt;BR /&gt; label: "Average household size"&lt;BR /&gt; }]&lt;BR /&gt; })&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;var legend = null;&lt;BR /&gt; &lt;BR /&gt; function selectFields() {&lt;/P&gt;&lt;P&gt;relationshipParams = {&lt;BR /&gt; field1: {&lt;BR /&gt; field: "EDUC01_CY",&lt;BR /&gt; normalizationField: "EDUCA_BASE"&lt;BR /&gt; },&lt;BR /&gt; field2: {&lt;BR /&gt; field: "AVGHHSZ_CY"&lt;BR /&gt; },&lt;BR /&gt; layer: layer,&lt;BR /&gt; basemap: "gray",&lt;BR /&gt; classificationMethod: "natural-breaks",&lt;BR /&gt; numClasses: 3,&lt;BR /&gt; showOthers: false,&lt;BR /&gt; focus: "HH" // rotates the legend like a diamond. Set to null to make it a square&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;var schemes = relationshipStyles.getSchemes({&lt;BR /&gt; theme: "default",&lt;BR /&gt; basemap: "gray",&lt;BR /&gt; geometryType: "polygon",&lt;BR /&gt; numColors: relationshipParams.numClasses&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;addOptions(schemes);&lt;/P&gt;&lt;P&gt;// Creates the predominance renderer&lt;BR /&gt; smartMapping.createRelationshipRenderer(relationshipParams)&lt;BR /&gt; .then(applyRenderer);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; function addOptions(schemes) {&lt;BR /&gt; var selectElem = document.getElementById("schemes");&lt;/P&gt;&lt;P&gt;var option = document.createElement("option");&lt;BR /&gt; option.value = "primary";&lt;BR /&gt; option.text = "primary";&lt;BR /&gt; selectElem.appendChild(option);&lt;/P&gt;&lt;P&gt;var secondarySchemes = schemes.secondarySchemes;&lt;BR /&gt; var primaryScheme = schemes.primaryScheme;&lt;/P&gt;&lt;P&gt;secondarySchemes.forEach(function (scheme, i) {&lt;BR /&gt; var option = document.createElement("option");&lt;BR /&gt; option.value = i;&lt;BR /&gt; option.text = "secondary " + (i + 1);&lt;BR /&gt; selectElem.appendChild(option);&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;selectElem.addEventListener("change", function (event) {&lt;BR /&gt; var selection = event.target.value;&lt;BR /&gt; relationshipParams.scheme = selection === "primary" ? primaryScheme : secondarySchemes[parseInt(selection)];&lt;BR /&gt; smartMapping.createRelationshipRenderer(relationshipParams)&lt;BR /&gt; .then(applyRenderer);&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function applyRenderer(response) {&lt;/P&gt;&lt;P&gt;var renderer = changeRendererLabels(response.renderer, showDescriptiveLabelsElement.checked);&lt;BR /&gt; layer.setRenderer(renderer);&lt;BR /&gt; layer.redraw();&lt;/P&gt;&lt;P&gt;if (!layer.visible) {&lt;BR /&gt; layer.setVisibility(true);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;legend.refresh();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function changeRendererLabels(renderer, showDescriptiveLabels) {&lt;/P&gt;&lt;P&gt;var numClasses = renderer.authoringInfo.numClasses;&lt;BR /&gt; var field1max = renderer.authoringInfo.field1.classBreakInfos[numClasses - 1].maxValue;&lt;BR /&gt; var field2max = renderer.authoringInfo.field2.classBreakInfos[numClasses - 1].maxValue;&lt;/P&gt;&lt;P&gt;renderer.infos.forEach(function (info) {&lt;BR /&gt; switch (info.value) {&lt;BR /&gt; case "HH":&lt;BR /&gt; info.label = showDescriptiveLabels ? "Large Households&amp;lt;br&amp;gt;Not formally educated" : "";&lt;BR /&gt; break;&lt;BR /&gt; case "HL":&lt;BR /&gt; info.label = showDescriptiveLabels ? "Small Households&amp;lt;br&amp;gt;Not much education" : Math.round(field1max * 100) + "%";&lt;BR /&gt; break;&lt;BR /&gt; case "LH":&lt;BR /&gt; info.label = showDescriptiveLabels ? "Large Households&amp;lt;br&amp;gt;Formally educated" : field2max;&lt;BR /&gt; break;&lt;BR /&gt; case "LL":&lt;BR /&gt; info.label = showDescriptiveLabels ? "Small Households&amp;lt;br&amp;gt;Not formally educated" : 0;&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;renderer.authoringInfo.focus = showDescriptiveLabels ? "HH" : null;&lt;/P&gt;&lt;P&gt;return renderer;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;var clazz = declare([BaseWidget, _WidgetsInTemplateMixin], {&lt;BR /&gt; baseClass: 'jimu-widget-Relationship',&lt;BR /&gt; &lt;BR /&gt; _hasContent: null,&lt;/P&gt;&lt;P&gt;postCreate: function () {&lt;BR /&gt; this.inherited(arguments);&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;startup: function () {&lt;BR /&gt; this.inherited(arguments);&lt;/P&gt;&lt;P&gt;legend = new Legend({&lt;BR /&gt; map: this.map,&lt;BR /&gt; layerInfos: [{&lt;BR /&gt; layer: layer,&lt;BR /&gt; title: "Mexico Educational Attainment"&lt;BR /&gt; }]&lt;BR /&gt; }, "legendDiv");&lt;BR /&gt; legend.startup();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; showDescriptiveLabelsElement = document.getElementById("descriptive-labels");&lt;/P&gt;&lt;P&gt;showDescriptiveLabelsElement.addEventListener("change", function (event) {&lt;BR /&gt; var renderer = changeRendererLabels(layer.renderer, showDescriptiveLabelsElement.checked);&lt;BR /&gt; layer.setRenderer(renderer);&lt;BR /&gt; layer.redraw();&lt;BR /&gt; legend.refresh();&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;onOpen: function () {&lt;BR /&gt; // Add the layer to the map&lt;BR /&gt; this.map.addLayer(layer);&lt;BR /&gt; selectFields();&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; return clazz;&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 09:51:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72284#M6521</guid>
      <dc:creator>SabriGhaith</dc:creator>
      <dc:date>2019-04-04T09:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72285#M6522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sabri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You have some Major issues in your code.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Actually i used to implement different samples, and i believe it is not about something wrong with my code.&lt;/BLOCKQUOTE&gt;&lt;OL&gt;&lt;LI&gt;The main sample code you have placed outside of any widget function. Major issue.&lt;/LI&gt;&lt;LI&gt;You need to add this sample code inside a widget function like startup or onOpen.&lt;/LI&gt;&lt;LI&gt;You are creating a Map and trying to assign it to an element with the id of map. In WAB there is already a map and you normally never need to create a new map object you just use "this.map" inside you widget code.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a lot more to making a JS API sample work in WAB then just copying the code into the widget.js.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 13:27:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72285#M6522</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-04T13:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72286#M6523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually it is my bad. I copied and pasted wrong code snippets from different places while i am trying to post this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code in the original post is updated now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 15:24:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72286#M6523</guid>
      <dc:creator>SabriGhaith</dc:creator>
      <dc:date>2019-04-04T15:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72287#M6524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sabri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You still have a lot of code outside your clazz declare... Do you not see errors in your browser console?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 15:38:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72287#M6524</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-04T15:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72288#M6525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only showstopper is the mentioned error related to the renderer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I traced all pieces and the code is navigating as expected through all functions.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;I have other widget.js structure, but that one is related to the business of my app itself, i just created this JS file to test the sample code almost as-is away from any external factors.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Apr 2019 09:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72288#M6525</guid>
      <dc:creator>SabriGhaith</dc:creator>
      <dc:date>2019-04-07T09:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72289#M6526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any update on this? Or did you try to embed the online sample into a custom widget and got working properly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 18:37:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72289#M6526</guid>
      <dc:creator>SabriGhaith</dc:creator>
      <dc:date>2019-04-09T18:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Mapping - Relationship Renderer 3.28 Error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72290#M6527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I&amp;nbsp;have no update and have not tried adding that sample as a widget myself.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2019 18:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/smart-mapping-relationship-renderer-3-28-error/m-p/72290#M6527</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-04-09T18:44:25Z</dc:date>
    </item>
  </channel>
</rss>

