Check that minPoint and maxPoint are not null
@@ -97,9 +97,11 @@ public class ExportTilesSample extends Application {
Point minPoint = mapView.screenToLocation(minScreenPoint);
Point maxPoint = mapView.screenToLocation(maxScreenPoint);
// use the points to define and return an envelope
+ if (minPoint != null && maxPoint != null) {
Envelope envelope = new Envelope(minPoint, maxPoint);
downloadArea.setGeometry(envelope);
}
+ }
});
// create button to export tiles
