Select to view content in your preferred language

Placing cylinder on featurelayer from array of client-side features

752
2
02-03-2022 06:06 AM
sab9000
Emerging Contributor

I'm testing the Javascript API for a project and  am trying to place some features on a featurelayer as an array of client-side features. Normal polygons work well, but I can't find the correct way of placing a circle (extruded to make a 3D cylinder). In my mind the array would look something like this:

 

const cylFeatures = [
   {
      geometry: {
         type: 'circle',
         center: [10.296842,61.313066],
      },
      attributes: {
         objectID: 200,
         elevation: 390,
         height: 5,
         width: 12
      }
   }
]

 

And then use unique value renderer to apply the width, height and elevation to the circle features. But this doesn't work of course. According to the documentation it seems like I can't use the circle type at all here.

I'm looking for clues to how I can do this.

 

0 Kudos
2 Replies
ReneRubalcava
Esri Frequent Contributor

For 3d points, you'll want to use an ObjectSymbol3DLayer. Here is a sample showing how it works.

0 Kudos
sab9000
Emerging Contributor

Thank you for your reply! I will look into this solution. For now I have made my cylinder by making a circular polygon (using turf.js) and extruding that.

0 Kudos