Places address autocomplete form doesn't account for sublocality_level_1

Aperta
#1,462 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
frontend, web-dev

Direzione di ricerca

Apri il places-autocomplete-addressform sample e riproduci il problema con 134 N Sixth St Brooklyn, NY. Confronta il sample con il fiddle collegato ed esegui il commit, quindi verifica che il suggerimento selezionato compili City con Brooklyn e rivedi le problematiche segnalate relative alla formattazione e a geometry-field.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Operating system

Windows 10 Pro 22H2

Browser Version

Chrome 111.0.5563.147

How severe is the bug?

low

Bug description

The developer documents specifically call-out the case that some addresses, like those in Brooklyn, need to use sublocality_level_1 instead of locality. Since this demo is US-centric, it seems reasonable to account for this case.

Developer Documentation Reference

I'm sure this does not cover every edge case, but it at least covers the one listed in the sample documentation.

Here's a fiddle with the fix and a commit but I believe opening an issue first is the appropriate workflow.

There were also some minor formatting inconsistencies which I don't think are intentional, but I could be wrong.

Finally, geometry is requested and not used which seems counter to the "only pull the fields you need" philosophy in the docs.

All of this is just for your consideration, as I can also understand not wanting to include it given the proviso of needing to adjust for certain situations in the docs. However, I do think this makes the sample more clear.

Steps to reproduce

Open the sample for places-autocomplete-addressform (the link in the bug description goes there)

Start typing address until suggestions appear.
Test address: 134 N Sixth St Brooklyn, NY (Google Store location)

Expected result: City is Brooklyn after selection of autocomplete suggestion showing Brooklyn.
Actual result: City is blank.

Console log output

No response

Lingua principale
TypeScript
Stelle
804
Fork
826
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googlemaps/js-samples

Tutte le issue di googlemaps/js-samples

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.