AnsweredAssumed Answered

FeatureLayer not showing in 4.9 vs. 4.8

Question asked by lorieme on Oct 30, 2018
Latest reply on Nov 1, 2018 by lorieme

When I use 4.9, the feature layer doesn't display on the map.  When I use 4.8, it does display. One possible problem may be that the spatial references are different between the basemap and my feature layer.  My layer in the map service has two unique values for its symbology, so I tried using a single symbol renderer in the code instead.

My goal is to edit the feature layer. 

 

require([

"esri/Map",

"esri/views/MapView",

"esri/layers/FeatureLayer",

"esri/Graphic",

//"esri/widgets/Expand",

//"esri/widgets/FeatureForm",

"esri/geometry/Extent",

"esri/geometry/SpatialReference"

],

function(

Map, MapView, FeatureLayer, Graphic,

//Expand, FeatureForm,

Extent, SpatialReference

) {

let editFeature, highlight, featureForm, editArea, attributeEditing, updateInstructionDiv;

var initialExtent = new Extent(

-117.83, 47.23,

-117.03, 48.055,

SpatialReference({ wkid: 4326 })

);

 

var citiesRenderer = {

type: "simple", // autocasts as new SimpleRenderer()

symbol: {

type: "simple-marker", // autocasts as new SimpleMarkerSymbol()

size: 10,

color: "#FF4000",

outline: { // autocasts as new SimpleLineSymbol()

color: [255, 64, 0, 0.4], // autocasts as new Color()

width: 7

}

}

};

 

const layerWorksite = new FeatureLayer({

//url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/IncidentsReport/FeatureServer/0",

url: "http://igis.spokanecounty.org/arcgis/rest/services/PublicWorks/CommuteTripReductionDev/MapServer/0",

renderer: citiesRenderer

 

});

const map = new Map({

basemap: "topo",

layers: [layerWorksite]

});

const view = new MapView({

container: "viewDiv",

map: map,

extent: initialExtent

//center: [-117.4123, 47.65726],

//zoom: 12

});

});

Outcomes