api addok

This commit is contained in:
Arnaud Delcasse 2025-03-31 08:02:38 +02:00
parent a33e9cbb15
commit e48112e2a1
2 changed files with 12 additions and 2 deletions

View File

@ -14,8 +14,13 @@
this.responselength = 0
return []
}
result = await fetch("https://api.geocode.earth/v1/autocomplete/\?api_key=ge-4949288cd450ad31&text=" + this.input)
if(this.input.length < 3) {
this.responselength = 0
return []
}
result = await fetch("https://api-adresse.data.gouv.fr/search/?q=" + this.input)
json = await result.json()
console.log(json)
this.responselength = json["features"].length
return json["features"]

View File

@ -15,8 +15,13 @@
this.responselength = 0
return []
}
result = await fetch("https://api.geocode.earth/v1/autocomplete/\?api_key=ge-4949288cd450ad31&text=" + this.input)
if(this.input.length < 3) {
this.responselength = 0
return []
}
result = await fetch("https://api-adresse.data.gouv.fr/search/?q=" + this.input)
json = await result.json()
console.log(json)
this.responselength = json["features"].length
return json["features"]