Skip to content

Commit f64b1ec

Browse files
Rachael-ERachael Ellen
andauthored
Fix BufferList sample bug (#525)
* fix initial viewpoint * refactor to display map * update comment Co-authored-by: Rachael Ellen <[email protected]>
1 parent 96aade0 commit f64b1ec

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

geometry/buffer-list/src/main/java/com/esri/samples/buffer_list/BufferListSample.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,19 @@ public void start(Stage stage) {
8888
);
8989
Polygon boundaryPolygon = (Polygon) GeometryEngine.project(new Polygon(new PointCollection(boundaryPoints)), statePlaneNorthCentralTexas);
9090

91-
// create a map view
92-
mapView = new MapView();
93-
94-
// create a map with a basemap and add it to the map view
91+
// create a blank map with a spatial reference and set an initial viewpoint
9592
ArcGISMap map = new ArcGISMap(statePlaneNorthCentralTexas);
96-
mapView.setMap(map);
97-
98-
// set an initial viewpoint
9993
map.setInitialViewpoint(new Viewpoint(boundaryPolygon.getExtent()));
10094

10195
// create an image layer from a service URL (counties, cities, and highways)
10296
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer");
10397
// add the image layer to the map's base layers
10498
map.getBasemap().getBaseLayers().add(mapImageLayer);
10599

100+
// create a map view and set the map to it
101+
mapView = new MapView();
102+
mapView.setMap(map);
103+
106104
// show alert if layer fails to load
107105
mapImageLayer.addDoneLoadingListener(() -> {
108106
if (mapImageLayer.getLoadStatus() != LoadStatus.LOADED) {

0 commit comments

Comments
 (0)