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) {
}
-$(document).ajaxError(function (event, jqXHR, ajaxSettings/* , thrownError */) {
- // console.log(thrownError);
- // console.log(ajaxSettings);
- var url = ajaxSettings.url;
- show_error('Error fetching results from <a href="' + url + '">' + url + '</a>');
-});
-
-
jQuery(document).ready(function () {
hide_error();
+
+ $(document).ajaxStart(function () {
+ $('#loading').fadeIn('fast');
+ }).ajaxComplete(function () {
+ $('#loading').fadeOut('fast');
+ }).ajaxError(function (event, jqXHR, ajaxSettings/* , thrownError */) {
+ // console.log(thrownError);
+ // console.log(ajaxSettings);
+ var url = ajaxSettings.url;
+ show_error('Error fetching results from <a href="' + url + '">' + url + '</a>');
+ });
});