picyka Posted November 12, 2020 Posted November 12, 2020 https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform#maps_places_autocomplete_addressform-javascript Has anyone done something like that, an entry autocomplete that searches address on google maps. Quote
RDybuco Posted August 11, 2022 Posted August 11, 2022 Did you solve this task? How? This feature would be very helpful. Quote
picyka Posted August 11, 2022 Author Posted August 11, 2022 13 minutos atrás, RDybuco disse: Você resolveu essa tarefa? Como? Este recurso seria muito útil. procedure TUniFormConsultaEndereco.cbPesquisaEnderecoRemoteQuery(const QueryString: string; Result: TStrings); begin var lRest := TRestNewUtils.Create('https://maps.googleapis.com/maps/api/place/autocomplete/json?input=' + TSparkleUtils.PercentEncode(QueryString) + '&language=pt_BR&key=' + _CHAVE_MAPS); try lRest.Execute; if lRest.Response.StatusCode <> 200 then Exit; var lObjectJson := lRest.ResponseJSONValue as TJSONObject; if lObjectJson.GetValue('status').Value.Equals('OK') then begin var lListPredictions := TJSONArray(lObjectJson.GetValue('predictions')); Result.Clear; for var I := 0 to lListPredictions.Count - 1 do Result.Add(AnsiUpperCase(lListPredictions.Items[I].GetValue<String>('description'))); end; finally lRest.Free; end; end; I made a separate screen without map. query address using google api. Quote
andyhill Posted August 13, 2022 Posted August 13, 2022 Which Delphi unit does TRestNewUtils come from ? Quote
picyka Posted August 13, 2022 Author Posted August 13, 2022 42 minutos atrás, Andyhill disse: De que unidade Delphi vem tRestNewUtils? You can use TRestClient Quote
picyka Posted August 13, 2022 Author Posted August 13, 2022 13 minutos atrás, Andyhill disse: Obrigado, e o TSparkleUtils? Can remove. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.