Having trouble extruding buildings in 3D

542
2
Jump to solution
06-27-2019 12:40 PM
benjaminfriedman
New Contributor

Hello All, 

Having some trouble rendering my featureLayer in 3D. I just want to extrude these building footprints by the "HEIGHT" attribute in the data. 

Here is the code I am using: 

//******Create a UniqueValueRenderer*********
var buildingRender = {
type: "unique-value",
visualVariables: [{
type: "size",
field: "HEIGHT",
valueUnit: "feet"

}]
};


//******add a buildings layer************
var featureLayer = new FeatureLayer({
url: "https://services1.arcgis.com/oI9yEqRrROLp8e7v/arcgis/rest/services/NUSCArea/FeatureServer/0",
renderer: buildingRender
})

map.add(featureLayer);

This what happens: 

to this: 

I saw some talk of also having to vreate a polygon-3D renderer or something but I couldn't figure it out! 

Any help would be really appreciated. 

Thanks so much. 

0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor
2 Replies
JohnGrayson
Esri Regular Contributor

You need to specify a symbol as well; check out this sample:

https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html

...and here's a codepen with your service:

https://codepen.io/john-grayson/pen/gNXErz?editors=1000

benjaminfriedman
New Contributor

Thank you so much John! It worked great. I really appreciate it.

0 Kudos