Skip to content

Commit

Permalink
reinit city name and geoloc when manual edit #2342
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed May 30, 2024
1 parent e000baf commit 19ab554
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/controllers/component_search_address.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ function addressResetGeoloc(input, isResetInsee) {
.then(json => {
json.features.forEach((feature) => {
if (feature.properties.citycode) {
document.querySelector('#' + idForm + ' [data-autocomplete-ville]').value = feature.properties.city
document.querySelector('#' + idForm + ' [data-autocomplete-insee]').value = feature.properties.citycode
document.querySelector('#' + idForm + ' [data-autocomplete-geoloclng]').value = feature.geometry.coordinates[0]
document.querySelector('#' + idForm + ' [data-autocomplete-geoloclat]').value = feature.geometry.coordinates[1]
}
})
})
}
}
}, 200)
}, 1000)
}

0 comments on commit 19ab554

Please sign in to comment.