Skip to content

Commit

Permalink
fix: map errors when no lat/lon is available
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Nov 26, 2023
1 parent 05e0818 commit e4f21ad
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions js/src/forum/components/ZipCodeMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ export default class ZipCodeMap extends Component {

this.data = null;

// if (this.ipInfo.zipCode()) {
// this.searchZip();
// } else {
// this.searchLatLon();
// }
this.searchLatLon();
if (this.ipInfo.zipCode()) {
this.searchZip();
} else {
this.searchLatLon();
}
}

view() {
Expand All @@ -50,8 +49,8 @@ export default class ZipCodeMap extends Component {
url: `https://nominatim.openstreetmap.org/search`,
method: 'GET',
params: {
q: this.inInfo.zipCode(),
countrycodes: this.inInfo.country(),
q: this.ipInfo.zipCode(),
countrycodes: this.ipInfo.countryCode(),
limit: 1,
format: 'json',
},
Expand Down

0 comments on commit e4f21ad

Please sign in to comment.