- // Reset
- $this->iMinAddressRank = 0;
- $this->iMaxAddressRank = 30;
- $this->aAddressRankList = array();
-
- $this->aStructuredQuery = array();
- $this->sAllowedTypesSQLList = false;
-
- $this->loadStructuredAddressElement($sAmenity, 'amenity', 26, 30, false);
- $this->loadStructuredAddressElement($sStreet, 'street', 26, 30, false);
- $this->loadStructuredAddressElement($sCity, 'city', 14, 24, false);
- $this->loadStructuredAddressElement($sCounty, 'county', 9, 13, false);
- $this->loadStructuredAddressElement($sState, 'state', 8, 8, false);
- $this->loadStructuredAddressElement($sPostalCode, 'postalcode', 5, 11, array(5, 11));
- $this->loadStructuredAddressElement($sCountry, 'country', 4, 4, false);
-
- if (!empty($this->aStructuredQuery)) {
- $this->sQuery = join(', ', $this->aStructuredQuery);
- if ($this->iMaxAddressRank < 30) {
- $this->sAllowedTypesSQLList = '(\'place\',\'boundary\')';
+ if ($sAmenity || $sStreet || $sCity || $sCounty || $sState || $sCountry || $sPostalCode) {
+ // Reset
+ $this->iMinAddressRank = 0;
+ $this->iMaxAddressRank = 30;
+ $this->aAddressRankList = array();
+
+ $this->aStructuredQuery = array();
+ $this->sAllowedTypesSQLList = false;
+
+ $this->loadStructuredAddressElement($sAmenity, 'amenity', 26, 30, false);
+ $this->loadStructuredAddressElement($sStreet, 'street', 26, 30, false);
+ $this->loadStructuredAddressElement($sCity, 'city', 14, 24, false);
+ $this->loadStructuredAddressElement($sCounty, 'county', 9, 13, false);
+ $this->loadStructuredAddressElement($sState, 'state', 8, 8, false);
+ $this->loadStructuredAddressElement($sPostalCode, 'postalcode', 5, 11, array(5, 11));
+ $this->loadStructuredAddressElement($sCountry, 'country', 4, 4, false);
+
+ if (!empty($this->aStructuredQuery)) {
+ $this->sQuery = join(', ', $this->aStructuredQuery);
+ if ($this->iMaxAddressRank < 30) {
+ $this->sAllowedTypesSQLList = '(\'place\',\'boundary\')';
+ }