Просмотр исходного кода

#3401 OSM: if exact address can't be geolocated then geolocate by zip or city

Alex Trofimov 5 лет назад
Родитель
Сommit
da7c8ec8b3
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      template/location_field_plain.html

+ 6 - 0
template/location_field_plain.html

@@ -35,6 +35,10 @@
         if (sCity.length)
             sRet = (sStreet.length && sNum.length ? sNum + ' ' : '') + (sStreet.length ? sStreet + ', ' : '') + sRet;
 
+        if ('undefined' !== typeof(sMode) &&  'address_wo_zip' == sMode) {
+            return sCity.length && sStreet.length ? (sStreet.length && sNum.length ? sNum + ' ' : '') + (sStreet.length ? sStreet + ', ' : '') + (sCity.length ? sCity + ', ': '') + (sState.length ? sState + ', ': '') + sCountry : '';
+        }
+
         return sRet;
     }
 
@@ -86,6 +90,8 @@
                 return;
             }
             var a = [s];
+            if (s = getLocationString('address_wo_zip'))
+                a.push(s);
             if (s = getLocationString('zip_only'))
                 a.push(s);
             if (s = getLocationString('city_only'))