Skip to content

Commit fb57b06

Browse files
committed
change extrusion mode to ABSOLUTE_HEIGHT
1 parent 9002d64 commit fb57b06

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed
-33.6 KB
Loading
-93.4 KB
Loading

src/main/java/com/esri/samples/featurelayers/feature_layer_extrusion/FeatureLayerExtrusionSample.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public void start(Stage stage) throws Exception {
7777
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, 0xFF000000, 1.0f);
7878
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0xFF0000FF, lineSymbol);
7979
final SimpleRenderer renderer = new SimpleRenderer(fillSymbol);
80-
// need to set an extrusion type, BASE HEIGHT extrudes each point from feature individually
81-
renderer.getSceneProperties().setExtrusionMode(Renderer.SceneProperties.ExtrusionMode.BASE_HEIGHT);
80+
// set the extrusion mode to absolute height
81+
renderer.getSceneProperties().setExtrusionMode(Renderer.SceneProperties.ExtrusionMode.ABSOLUTE_HEIGHT);
8282
statesFeatureLayer.setRenderer(renderer);
8383

8484
// set camera to focus on state features
@@ -98,13 +98,13 @@ public void start(Stage stage) throws Exception {
9898
Button extrusionButton = new Button("Population Density");
9999
extrusionButton.setOnAction(v -> {
100100
if (showTotalPopulation) {
101-
// some feature's population is really big of need to sink it down
101+
// scale down outlier populations
102102
renderer.getSceneProperties().setExtrusionExpression("[POP2007]/ 10");
103103
extrusionButton.setText("Population Density");
104104
showTotalPopulation = false;
105105
} else {
106-
// density of population is a small value to need to increase it
107-
renderer.getSceneProperties().setExtrusionExpression("[POP07_SQMI] * 5000");
106+
// scale up density
107+
renderer.getSceneProperties().setExtrusionExpression("[POP07_SQMI] * 5000 + 100000");
108108
extrusionButton.setText("Total Population");
109109
showTotalPopulation = true;
110110
}
-13.7 KB
Loading

src/main/java/com/esri/samples/scene/extrude_graphics/ExtrudeGraphicsSample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void start(Stage stage) throws Exception {
9090
// set renderer with extrusion property
9191
SimpleRenderer renderer = new SimpleRenderer();
9292
SceneProperties renderProperties = renderer.getSceneProperties();
93-
renderProperties.setExtrusionMode(SceneProperties.ExtrusionMode.BASE_HEIGHT);
93+
renderProperties.setExtrusionMode(SceneProperties.ExtrusionMode.ABSOLUTE_HEIGHT);
9494
renderProperties.setExtrusionExpression("[HEIGHT]");
9595
graphicsOverlay.setRenderer(renderer);
9696

src/main/java/com/esri/samples/scene/extrude_graphics/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
<ol>
1717
<li>Create a <code>GraphicsOverlay</code> and <code>SimpleRenderer</code>.</li>
1818
<li>Get the renderer's <code>SceneProperties</code> using <code>Renderer.getSceneProperties()</code>.</li>
19-
<li>Set the extrusion mode for the renderer with <code>SceneProperties.setExtrusionMode(ExtrusionMode)</code>.
20-
<ul><li>BASE_HEIGHT, graphic is extruded to various z-values</li></ul></li>
19+
<li>Set the extrusion mode for the renderer with <code>SceneProperties.setExtrusionMode(ExtrusionMode)</code>.</li>
2120
<li>Specify the attribute name of the graphic that the extrusion mode will use, <code>SceneProperties
2221
.setExtrusionExpression("[HEIGHT]")</code>.</li>
2322
<li>Set the renderer on the graphics overlay, <code>GraphicsOverlay.setRenderer(Renderer)</code>.</li>

0 commit comments

Comments
 (0)