* Use OpenStreetMaps Nominatim for Geolocation
*/
var nominatimAPI = "https://nominatim.openstreetmap.org/search/";
- var addressMapFail = 'Sorry, we were unable to get a map position from the address provided.';
+ var addressMapFail = 'Sorry, we were unable to get a map position from the address provided.';
$(document).on('click','#glm-estimate-location', function() {
var addrStreet = $('#addr1').val();
var addrCountry = $('#country').val();
var addrZip = $('#zip').val();
- var haveLocation = false;
-
var location = $.getJSON( nominatimAPI, {
format: 'json',
street: addrStreet,
alert(addressMapFail);
} else {
assignNewPosition(data);
- alert('We were unable to match all of your address data but did find this location.\nPlease check that it is correct and adjust as needed by dragging the map pointer.');
+ alert('We were unable to match all of your address data but did find this location.\n\n' + data[0].display_name + '\n\nPlease check that it is correct and adjust as needed by dragging the map pointer.\nYou may also want to check the city selected in the address.');
}
});
} else {