-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeographicLocatorMapConfig.java
executable file
·53 lines (45 loc) · 1.84 KB
/
GeographicLocatorMapConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// GeographicLocatorMapConfig.java is a simple class to allow defining the
// configuration for different geographic locator maps.
//---------------------------------------------------------------------------
public class GeographicLocatorMapConfig
{
public int imageWidth = 1007;
public int imageHeight = 503;
public double leftLon = -180.0;
public double rightLon = 180.0;
public double topLat = 90.0;
public double bottomLat = -90.0;
public double degreesPerPixelLon;
public double degreesPerPixelLat;
public String mapImage;
public String boundaryImage;
// set this to true if you want to limit the arrow buttons to the
// geographic bumper.
public boolean enforceGeographicBumper;
// set this to true if the locator map crosses the international date line
public boolean crossesDateLine;
// set this to false if there is no boundaries image to overlay on the
// locator map
public boolean useBoundaryImage;
// constructor
//------------
public GeographicLocatorMapConfig(
int imageWidth, int imageHeight, double leftLon, double rightLon,
double topLat, double bottomLat, String mapImage, String boundaryImage,
boolean enforceGeographicBumper, boolean crossesDateLine)
{
this.imageWidth = imageWidth;
this.imageHeight = imageHeight;
this.leftLon = leftLon;
this.rightLon = rightLon;
this.topLat = topLat;
this.bottomLat = bottomLat;
this.mapImage = mapImage;
this.boundaryImage = boundaryImage;
this.enforceGeographicBumper = enforceGeographicBumper;
this.crossesDateLine = crossesDateLine;
useBoundaryImage = (boundaryImage != null);
degreesPerPixelLon = (rightLon - leftLon) / imageWidth;
degreesPerPixelLat = (topLat - bottomLat) / imageHeight;
}
}