diff options
| author | Bdale Garbee <bdale@gag.com> | 2018-10-08 16:07:32 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2018-10-08 16:07:32 -0600 | 
| commit | 24db798925e26a4c411afe88f7e4844d6554fe0c (patch) | |
| tree | 6e6a86d40627d90633a7bf4f056d8e7bfb07b125 /map-server/altos-mapd/AltosMapd.java | |
| parent | 6f25d2359151fb114e22bf8e3b15c007cfb464b5 (diff) | |
| parent | 03680c55ae8394056ed27839e64356d8df375537 (diff) | |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'map-server/altos-mapd/AltosMapd.java')
| -rw-r--r-- | map-server/altos-mapd/AltosMapd.java | 16 | 
1 files changed, 15 insertions, 1 deletions
diff --git a/map-server/altos-mapd/AltosMapd.java b/map-server/altos-mapd/AltosMapd.java index 1be1655d..29528541 100644 --- a/map-server/altos-mapd/AltosMapd.java +++ b/map-server/altos-mapd/AltosMapd.java @@ -32,6 +32,8 @@ public class AltosMapd implements AltosLaunchSiteListener {  	public final static int scale = 1; +	public static int max_zoom = 17; +  	public static double valid_radius = 17000;	/* 17km */  	public String map_dir = null; @@ -40,7 +42,8 @@ public class AltosMapd implements AltosLaunchSiteListener {  	public void usage() {  		System.out.printf("usage: altos-mapd [--mapdir <map-directory] [--launch-sites <launch-sites-file>]\n" + -				  "                  [--radius <valid-radius-m> [--port <port>] [--key <key-file>]\n"); +				  "                  [--radius <valid-radius-m> [--port <port>] [--key <key-file>]\n" + +				  "                  [--max-zoom <max-zoom-level>\n");  		System.exit(1);  	} @@ -69,6 +72,10 @@ public class AltosMapd implements AltosLaunchSiteListener {  	}  	public static boolean check_lat_lon(double lat, double lon, int zoom) { + +		if (zoom > max_zoom) +			return false; +  		AltosMapTransform	transform = new AltosMapTransform(px_size, px_size, zoom, new AltosLatLon(lat, lon));  		AltosLatLon		upper_left = transform.screen_lat_lon(new AltosPointInt(0, 0)); @@ -156,6 +163,13 @@ public class AltosMapd implements AltosLaunchSiteListener {  			} else if (args[i].equals("--key") && i < args.length-1) {  				key_file = args[i+1];  				skip = 2; +			} else if (args[i].equals("--max-zoom") && i < args.length-1) { +				try { +					max_zoom = AltosParse.parse_int(args[i+1]); +				} catch (ParseException pe) { +					usage(); +				} +				skip = 2;  			} else {  				usage();  			}  | 
