Skip to content

Commit 93f61c5

Browse files
author
pdavidc
committed
Updated the ScreenSelection example to normalize out-of-range longitudes for issue #59
1 parent b762c00 commit 93f61c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/gov/nasa/worldwindx/examples/ScreenSelection.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import gov.nasa.worldwind.WorldWindow;
99
import gov.nasa.worldwind.event.*;
10-
import gov.nasa.worldwind.geom.LatLon;
10+
import gov.nasa.worldwind.geom.*;
1111
import gov.nasa.worldwind.layers.RenderableLayer;
1212
import gov.nasa.worldwind.render.*;
1313
import gov.nasa.worldwindx.applications.worldwindow.util.Util;
@@ -63,15 +63,15 @@ protected void addShapes()
6363
highlightAttrs.setInteriorMaterial(Material.RED);
6464
highlightAttrs.setOutlineMaterial(Material.WHITE);
6565

66-
for (int lon = -180; lon < 180; lon += 10)
66+
for (int lon = -180; lon <= 170; lon += 10)
6767
{
68-
for (int lat = -90; lat < 90; lat += 10)
68+
for (int lat = -60; lat <= 60; lat += 10)
6969
{
7070
ExtrudedPolygon poly = new ExtrudedPolygon(Arrays.asList(
71-
LatLon.fromDegrees(lat - 1, lon - 1),
72-
LatLon.fromDegrees(lat - 1, lon + 1),
73-
LatLon.fromDegrees(lat + 1, lon + 1),
74-
LatLon.fromDegrees(lat + 1, lon - 1)),
71+
LatLon.fromDegrees(lat - 1, Angle.normalizedDegreesLongitude(lon - 1)),
72+
LatLon.fromDegrees(lat - 1, Angle.normalizedDegreesLongitude(lon + 1)),
73+
LatLon.fromDegrees(lat + 1, Angle.normalizedDegreesLongitude(lon + 1)),
74+
LatLon.fromDegrees(lat + 1, Angle.normalizedDegreesLongitude(lon - 1))),
7575
100000d);
7676
poly.setHighlightAttributes(highlightAttrs);
7777
poly.setSideHighlightAttributes(highlightAttrs);

0 commit comments

Comments
 (0)