Using 4.11 version of the JS API, trying to visualize a polygon feature layer in 3D - these features start on the ground and should be extruded to a given height.
I can get the extrusion to work using visual variables. But if the height is under the elevation of the terrain (lets say the height is only 100 meters), then the layer "disappears" under the terrain (see screenshot).
I thought I could solve this by using elevationInfo's mode "on-the-ground", but I'm still getting the same issue.
Am I doing something wrong here?
Here is my elevationInfo:
<SPAN class="keyword token">const</SPAN> elevationInfo <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
mode<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"on-the-ground"</SPAN><SPAN class="punctuation token">,</SPAN>
offset<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">100</SPAN><SPAN class="punctuation token">,</SPAN>
unit<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'feet'</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Here is my renderer:
<SPAN class="comment token">//ValueExpression up here</SPAN>
<SPAN class="keyword token">var</SPAN> visualVariables <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"size"</SPAN><SPAN class="punctuation token">,</SPAN>
valueExpression<SPAN class="punctuation token">:</SPAN> ValueExpression
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> symbol <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"polygon-3d"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// autocasts as new PolygonSymbol3D()</SPAN>
symbolLayers<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"extrude"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// autocasts as new ExtrudeSymbol3DLayer()</SPAN>
<SPAN class="comment token">//size: 1000, // Height of the extrusion in meters</SPAN>
material<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN> color<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="number token">155</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">155</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">155</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
edges<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"solid"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="comment token">// autocasts as new SolidEdges3D()</SPAN>
color<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0.5</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> renderer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
type<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'simple'</SPAN><SPAN class="punctuation token">,</SPAN>
symbol<SPAN class="punctuation token">:</SPAN> symbol<SPAN class="punctuation token">,</SPAN>
visualVariables<SPAN class="punctuation token">:</SPAN> visualVariables
<SPAN class="punctuation token">}</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I assign renderer to feature layer renderer, and elevationInfo to feature layer elevationInfo.
If I set the offset to something ridiculously high in elevationInfo, I can see my layer, but I want the base draped on the ground and extruded to the value above the terrain.
Any suggestions?