Minor update to message displayed when address is found without using city name.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 26 Oct 2018 14:55:22 +0000 (10:55 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 26 Oct 2018 14:55:22 +0000 (10:55 -0400)
Nominatim dosn't check the "preferred" city name from the US ZIP database,
but can often find the address without the city name.

views/admin/member/memberInfo/editProfileAddress.html

index 78581d2..d4dba38 100755 (executable)
                  * 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 {