AnsweredAssumed Answered

How to add Feature Layer for SenceView in AWAB?

Question asked by lixiaogiser on May 6, 2016


I try to add feature layer in AWAB, but error is "no add function" for the feautre layer i created.

Here is the code:

this.routeLayer = new FeatureLayer({
   id: "routeLayer",
   geometryType: "polyline",
   objectIdField: "id",
   fields: [
   new Field({
   "name": "id",
   "alias": "id",
   "type": "oid"
   }
   source: [],
  hasZ: true,
   elevationInfo: {
   mode: "relative-to-ground",
   offset: this.ROUTE_OFFSET
   },
   opacity: 0.7,
   renderer: new SimpleRenderer({
   symbol: new LineSymbol3D({
   symbolLayers: [
   new PathSymbol3DLayer({
   size: 5.0,
   material: {
   color: Color.named.gold

  

this.sceneView.map.add(this.routeLayer

 

var routeResult = routeResponse.routeResults[0];

// ROUTE GEOMETRY //
var routeGeom = new Polyline({
  hasZ: false,
  paths: lang.clone(routeResult.route.geometry.paths),
  spatialReference: routeResult.spatialReference
});

// ROUTE GRAPHIC //
var routeGraphic = new Graphic(routeGeom, null, routeResult.route.attributes);
this.routeLayer.source.add(routeGraphic);

);

},

Outcomes