AnsweredAssumed Answered

missing simple renderer/resources in local api build using bower/dojo

Question asked by arzon94 on Jan 9, 2018

Summary: specific feature layer/simple renderer will work using the esri-hosted version of the api but not using local copy (all other feature layers work)


To replicate the issue, go to then More > AED Locations, view the console error, then try the same steps using the esri-hosted api to see it work there


The error listed says "Uncaught (in promise) TypeError: i.getSymbol is not a function" the files referenced are not helpful in identifying the error as variables are fairly ambiguous but on the surface it seems like an issue with rendering the symbol for the featureLayer


I thought it may be the aed.png for the simplerenderer is referenced in the wrong location, but put in a black simple-marker dot does not solve the issue.


Has someone had a similar error? Is this an issue with the build profile someone can identify for me? Any insight would be greatly appreciated. I'll attach the full main.js and the build profile


the relevant code for the featurelayer:

function toggleAEDs() {
], function(esriRequest, Point, Legend, esriConfig, SimpleRenderer) {
var aedurl = "";
getData().then(createGraphics). // then send it to the createGraphics() method
then(createLayer). // when graphics are created, create the layer
//attempt to access the aedlive feed. if not, return the local aedfeed.json
function getData() {
return esriRequest(aedurl).then(function(response) {
return response;
}).otherwise(function(error) {
console.log('request failed, grabbing local feed');
return esriRequest("scripts/aedfeed.json", {responseType: "json"});
function createGraphics(response) {
// raw GeoJSON data
var geoJson =;
// Create an array of Graphics from each GeoJSON feature
return, i) {
return {
geometry: new Point({x: feature.geometry.coordinates[0], y: feature.geometry.coordinates[1]}),
// select only the attributes you care about
attributes: {
ObjectID: i,
function createLayer(graphics) {

var fields = [
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}, {
name: "building",
alias: "building",
type: "string"
}, {
name: "room",
alias: "room",
type: "string"
}, {
name: "location",
alias: "location",
type: "string"
}, {
name: "picture",
alias: "picture",
type: "string"
var template = {
title: "AED #{ObjectID}",
content: "<img src='{picture}' height='320' width='240'/><div class='popupText'>{building} room {room} {location} </div>"
var featureLayer = new FeatureLayer({
source: graphics, // autocast as an array of esri/Graphic
// create an instance of esri/layers/support/Field for each field object
fields: fields, // This is required when creating a layer from Graphics
objectIdField: "ObjectID", // This must be defined when creating a layer from Graphics
renderer: {
type: "simple", // autocasts as new SimpleRenderer()
symbol: {
type: "picture-marker", // autocasts as new SimpleMarkerSymbol()
url: "aed.png",
width: "30px",
height: "56px"
spatialReference: {
wkid: 4326
popupTemplate: template,
geometryType: "point", // Must be set when creating a layer from Graphics

return featureLayer;
function createLegend(layer) {}
function errback(error) {
console.error("Creating failed. ", error);