summaryrefslogtreecommitdiff
path: root/map-server/altos-mapd/AltosMapdClient.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-10-06 19:33:51 -0700
committerKeith Packard <keithp@keithp.com>2018-10-06 19:48:41 -0700
commite7c0bcd945f8365e86e99b9d450f3a3389fa0e66 (patch)
treee2f2945b50004313000e2d063f0c00486ce11513 /map-server/altos-mapd/AltosMapdClient.java
parentc7b1f3c6722ae59d09a888084075664446ff2768 (diff)
altos-mapd: Add geo-fencing for map requests. Add port and key arguments
Map requests are now limited to a region within 17km of any registered launch site. The --port argument allows the listen port to be changed. The --key argument provides the name of a file containing the Google maps API key. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'map-server/altos-mapd/AltosMapdClient.java')
-rw-r--r--map-server/altos-mapd/AltosMapdClient.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/map-server/altos-mapd/AltosMapdClient.java b/map-server/altos-mapd/AltosMapdClient.java
index fb0c08e6..70ceae82 100644
--- a/map-server/altos-mapd/AltosMapdClient.java
+++ b/map-server/altos-mapd/AltosMapdClient.java
@@ -77,7 +77,10 @@ public class AltosMapdClient extends Thread implements AltosMapStoreListener {
addr == null)
{
set_status(400);
+ } else if (!AltosMapd.check_lat_lon(lat, lon)) {
+ set_status(403); /* Forbidden */
} else {
+
store_ready = new Semaphore(0);
System.out.printf("Fetching tile for %g %g %d\n", lat, lon, zoom);