Query Task with 3D Scene

1397
15
11-28-2018 01:49 PM
Rocky_
by
Occasional Contributor

I am trying to Display Object symbol layer after performing query task on feature data layer. 

I have a feature layer URL which one am using for query task and then eventually this result displays on map in scene view. In this layer there is files INVERT-ELEVATION which gives value for depth of the Vertical pipes.

But i cant able to display all these pipes proportional to the field INVERT-ELEVATION.

Please feel free to ask any questions. Thanks..

if(22layer.value === 'Layer22'){
    feature.symbol = {
        type: "point-3d",
        symbolLayers: [{
            type: "object",
            resource: {
               primitive: "cylinder"
   },
   anchor: "bottom",
   material: {
      color: "red"
   },
   width: 100
   }],
visualVariables: [{
      type: "size",
      field: "INVERTELEVATION",
      axis: "height",
      valueUnit: "meters"
}]
};
feature.popupTemplate = Layer22PopupTemp;
}

0 Kudos
15 Replies
Rocky_
by
Occasional Contributor

Yes absolutely right.. I tried to display depth of these vertical pipes in proportinal to INVERTELEVATION field.. but its not working.. I have already used this previously but its with by using Renderer. like below

var DepthRenderer = {
      type: "simple", 
      symbol: {
      type: "point-3d", 
      symbolLayers: [{
         type: "object", 
         resource: {
            primitive: "cylinder"
         },
      anchor: "bottom",
      material: {
         color: "red"
      }
   }]
},
visualVariables: [{
      type: "size",
      field: "INVERTELEVATION",
      axis: "height",
      unitValue: "meters"
      }, {
      type: "size",
      axis: "width-and-depth",
      useSymbolValue: true
   }]
};
var SanLyr = new FeatureLayer({
      url: SanUrl,
      definitionExpression: "",
      outFields: ["*"],
      popupTemplate: sanTemplate,
      renderer: sanDepthRenderer,
      elevationInfo: {
            mode: "on-the-ground"
      },
      maxScale: 0,
      minScale: 16000
});

but when am trying to use it along with query task its not working.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rocky,

  OK now I see the issue. You can not use visualvariables on a GraphicsLayers symbol. VisualVariables only apply to Renderers and a Garphicslayer does not have a renderer.

Rocky_
by
Occasional Contributor

So what can i do if i want to display these kind of depth in 3D using INVERTELEVATION.

Is there any other possible option to do that..??

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Create a FeatureLayer from the query results using the FeatureLayer source property to add the graphics.

Create a FeatureLayer with client side graphics | ArcGIS API for JavaScript 4.9 

Rocky_
by
Occasional Contributor

You mean to say I have to use renedrer and use it in feature layer.

but Sir, i dont understand how to create feature layer from the query result.

can you please elaborate.

var SanLyr = new FeatureLayer({

      url: SanUrl,
      outFields: ["*"],
      popupTemplate: SanPopupTemp,
      title: "Sanitary and Combined Manholes",
      maxScale: 0,
      minScale: 16000,
      renderer: depthRenderer,
      elevationInfo: {
            mode: "on-the-ground"
      },
      visible: false
});

var depthRenderer = {
      type: "simple",
      symbol: {
            type: "point-3d",
            symbolLayers: [{
                  type: "object",
            resource: {
                  primitive: "cylinder"
            },
      anchor: "top",
      material: {
            color: "red"
      },
      width: 100
}]
},
label: "Manholes",
visualVariables: [{
      type: "size",
      field: "INVERTELEVATION",
      axis: "height",
      valueUnit: "meters"
      }, {
      type: "size",
      axis: "width-and-depth",
      useSymbolValue: true
}]
}

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I provided a sample in my last reply that creates a FeatureLayer from an array of graphics (which is essentially what a query result is, an array of graphics).

0 Kudos