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;
}
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.
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.
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..??
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
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
}]
}
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).