.DS_Store
+dist/config.js
node_modules
var map;
var last_click_latlng;
+// *********************************************************
+// DEFAULTS
+// *********************************************************
+
+var Nominatim_Config_Defaults = {
+ Nominatim_API_Endpoint: 'http://localhost/nominatim/',
+ Images_Base_Url: '/mapicons/',
+ Search_AreaPolygons: 1,
+ Reverse_Default_Search_Zoom: 18,
+ Map_Default_Lat: 20.0,
+ Map_Default_Lon: 0.0,
+ Map_Default_Zoom: 2,
+ Map_Tile_URL: 'https://{s}.tile.osm.org/{z}/{x}/{y}.png',
+ Map_Tile_Attribution: '<a href="https://osm.org/copyright">OpenStreetMap contributors</a>'
+};
// *********************************************************
// HELPERS
// *********************************************************
+
function get_config_value(str, default_val) {
- return (typeof Nominatim_Config[str] !== 'undefined' ? Nominatim_Config[str] : default_val);
+ var value = ((typeof Nominatim_Config !== 'undefined')
+ && (typeof Nominatim_Config[str] !== 'undefined'))
+ ? Nominatim_Config[str]
+ : Nominatim_Config_Defaults[str];
+ return (typeof value !== 'undefined' ? value : default_val);
}
function parse_and_normalize_geojson_string(part) {
context = {
sQuery: api_request_params.q,
sViewBox: search_params.get('viewbox'),
- env: Nominatim_Config
+ env: {}
};
if (api_request_params.street || api_request_params.city || api_request_params.county
--- /dev/null
+// The app loads an optional file config.js
+//
+// You can use this file as base for config.js (just copy or rename it), all
+// keys are optional.
+
+var Nominatim_Config = [];
+
+// Where Nominatim API runs. Remember to add port if needed and trailing slash.
+// Nominatim_Config['Nominatim_API_Endpoint'] = 'http://localhost/nominatim/';
+Nominatim_Config['Nominatim_API_Endpoint'] = 'https://nominatim.openstreetmap.org/';
+
+// Nominatim_Config['Images_Base_Url'] = '/mapicons/';
+
+// If the API should return polygons to be displayed on the map
+// Nominatim_Config['Search_AreaPolygons'] = 1;
+// Nominatim_Config['Reverse_Default_Search_Zoom'] = 18;
+
+// ---- MAP ----
+// For what {x}, {y} etc stand for see
+// https://leafletjs.com/reference-1.6.0.html#tilelayer
+// Nominatim_Config['Map_Tile_URL'] = 'https://{s}.tile.osm.org/{z}/{x}/{y}.png';
+
+// Can be text or HTML. To hide set to ''
+// Nominatim_Config['Map_Tile_Attribution'] = '<a href="https://osm.org/copyright">OpenStreetMap contributors</a>';
+
+// Nominatim_Config['Map_Default_Lat'] = 20.0;
+// Nominatim_Config['Map_Default_Lon'] = 0.0;
+// Nominatim_Config['Map_Default_Zoom'] = 2;
+++ /dev/null
-var Nominatim_Config = {
- "Nominatim_API_Endpoint": 'http://localhost:8089/nominatim/',
- "Images_Base_Url": '/mapicons/',
- "Search_AreaPolygons": 1,
- "Reverse_Default_Search_Zoom": 18,
- "Map_Default_Lat": 20.0,
- "Map_Default_Lon": 0.0,
- "Map_Default_Zoom": 2,
- "Map_Tile_URL": "https://{s}.tile.osm.org/{z}/{x}/{y}.png",
- "Map_Tile_Attribution": ""
-};
var map;
var last_click_latlng;
+// *********************************************************
+// DEFAULTS
+// *********************************************************
+
+var Nominatim_Config_Defaults = {
+ Nominatim_API_Endpoint: 'http://localhost/nominatim/',
+ Images_Base_Url: '/mapicons/',
+ Search_AreaPolygons: 1,
+ Reverse_Default_Search_Zoom: 18,
+ Map_Default_Lat: 20.0,
+ Map_Default_Lon: 0.0,
+ Map_Default_Zoom: 2,
+ Map_Tile_URL: 'https://{s}.tile.osm.org/{z}/{x}/{y}.png',
+ Map_Tile_Attribution: '<a href="https://osm.org/copyright">OpenStreetMap contributors</a>'
+};
// *********************************************************
// HELPERS
// *********************************************************
+
function get_config_value(str, default_val) {
- return (typeof Nominatim_Config[str] !== 'undefined' ? Nominatim_Config[str] : default_val);
+ var value = ((typeof Nominatim_Config !== 'undefined')
+ && (typeof Nominatim_Config[str] !== 'undefined'))
+ ? Nominatim_Config[str]
+ : Nominatim_Config_Defaults[str];
+ return (typeof value !== 'undefined' ? value : default_val);
}
function parse_and_normalize_geojson_string(part) {
context = {
sQuery: api_request_params.q,
sViewBox: search_params.get('viewbox'),
- env: Nominatim_Config
+ env: {}
};
if (api_request_params.street || api_request_params.city || api_request_params.county
--- /dev/null
+// The app loads an optional file config.js
+//
+// You can use this file as base for config.js (just copy or rename it), all
+// keys are optional.
+
+var Nominatim_Config = [];
+
+// Where Nominatim API runs. Remember to add port if needed and trailing slash.
+// Nominatim_Config['Nominatim_API_Endpoint'] = 'http://localhost/nominatim/';
+Nominatim_Config['Nominatim_API_Endpoint'] = 'https://nominatim.openstreetmap.org/';
+
+// Nominatim_Config['Images_Base_Url'] = '/mapicons/';
+
+// If the API should return polygons to be displayed on the map
+// Nominatim_Config['Search_AreaPolygons'] = 1;
+// Nominatim_Config['Reverse_Default_Search_Zoom'] = 18;
+
+// ---- MAP ----
+// For what {x}, {y} etc stand for see
+// https://leafletjs.com/reference-1.6.0.html#tilelayer
+// Nominatim_Config['Map_Tile_URL'] = 'https://{s}.tile.osm.org/{z}/{x}/{y}.png';
+
+// Can be text or HTML. To hide set to ''
+// Nominatim_Config['Map_Tile_Attribution'] = '<a href="https://osm.org/copyright">OpenStreetMap contributors</a>';
+
+// Nominatim_Config['Map_Default_Lat'] = 20.0;
+// Nominatim_Config['Map_Default_Lon'] = 0.0;
+// Nominatim_Config['Map_Default_Zoom'] = 2;
+++ /dev/null
-var Nominatim_Config = {
- "Nominatim_API_Endpoint": 'http://localhost:8089/nominatim/',
- "Images_Base_Url": '/mapicons/',
- "Search_AreaPolygons": 1,
- "Reverse_Default_Search_Zoom": 18,
- "Map_Default_Lat": 20.0,
- "Map_Default_Lon": 0.0,
- "Map_Default_Zoom": 2,
- "Map_Tile_URL": "https://{s}.tile.osm.org/{z}/{x}/{y}.png",
- "Map_Tile_Attribution": ""
-};