diff --git a/htdocs/map-google.html b/htdocs/map-google.html index 72bc3c20..570a649b 100644 --- a/htdocs/map-google.html +++ b/htdocs/map-google.html @@ -17,7 +17,7 @@

Colors

- diff --git a/htdocs/map-leaflet.html b/htdocs/map-leaflet.html index e85ac322..51f44669 100644 --- a/htdocs/map-leaflet.html +++ b/htdocs/map-leaflet.html @@ -16,8 +16,15 @@
+

Map

+

Colors

- diff --git a/owrx/config/defaults.py b/owrx/config/defaults.py index bc24c3eb..b392dadd 100644 --- a/owrx/config/defaults.py +++ b/owrx/config/defaults.py @@ -165,6 +165,7 @@ defaultConfig = PropertyLayer( tuning_precision=2, squelch_auto_margin=10, google_maps_api_key="", + map_type="google", map_position_retention_time=2 * 60 * 60, map_prefer_recent_reports=True, map_ignore_indirect_reports=False, diff --git a/owrx/connection.py b/owrx/connection.py index 2caa4d67..69fc4389 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -486,6 +486,7 @@ class MapConnection(OpenWebRxClient): filtered_config = pm.filter( "google_maps_api_key", "receiver_gps", + "map_type", "map_position_retention_time", "map_ignore_indirect_reports", "map_prefer_recent_reports", diff --git a/owrx/controllers/settings/general.py b/owrx/controllers/settings/general.py index 06b7c9f6..4e2390f2 100644 --- a/owrx/controllers/settings/general.py +++ b/owrx/controllers/settings/general.py @@ -207,6 +207,14 @@ class GeneralSettingsController(SettingsFormController): ), Section( "Map settings", + DropdownInput( + "map_type", + "Map type", + options=[ + Option("google", "Google Maps"), + Option("leaflet", "OpenStreetMap, etc."), + ], + ), TextInput( "google_maps_api_key", "Google Maps API key", diff --git a/owrx/controllers/template.py b/owrx/controllers/template.py index c1155a2b..0aff4d1e 100644 --- a/owrx/controllers/template.py +++ b/owrx/controllers/template.py @@ -1,5 +1,6 @@ from owrx.controllers import Controller from owrx.details import ReceiverDetails +from owrx.config import Config from string import Template import pkg_resources @@ -42,7 +43,8 @@ class IndexController(WebpageController): class MapController(WebpageController): def indexAction(self): # TODO check if we have a google maps api key first? - self.serve_template("map-google.html", **self.template_variables()) + pm = Config.get() + self.serve_template("map-%s.html" % pm["map_type"], **self.template_variables()) class PolicyController(WebpageController): diff --git a/owrx/eibi.py b/owrx/eibi.py index 7ffff4c7..f40856dc 100644 --- a/owrx/eibi.py +++ b/owrx/eibi.py @@ -358,6 +358,7 @@ EIBI_Countries = { "EEu": "Eastern Europe", "ENA": "Eastern North America", "ENE": "East-Northeast", + "EOc": "Eastern Oceania", "ESE": "East-Southeast", "Eu" : "Europe, incl. North Africa / Middle East", "FE" : "Far East", @@ -374,6 +375,7 @@ EIBI_Countries = { "NE" : "Northeast", "NNE": "North-Northeast", "NNW": "North-Northwest", + "NOc": "North Oceania", "NW" : "Northwest", "Oc" : "Oceania (Australia, New Zealand, Pacific Ocean)", "S..": "South ..", @@ -386,6 +388,7 @@ EIBI_Countries = { "SEA": "South East Asia", "SEE": "South East Europe", "Sib": "Siberia", + "SOc": "South Oceania", "SSE": "South-Southeast", "SSW": "South-Southwest", "SW" : "Southwest", @@ -397,6 +400,7 @@ EIBI_Countries = { "WIO": "Western Indian Ocean", "WNA": "Western North America", "WNW": "West-Northwest", + "WOc": "Western Oceania", "WSW": "West-Southwest", # ITU codes start here "ABW": "Aruba",