Google Maps API V3 - Anyway to retrieve Autocomplete results instead of dropdown rendering it?

后端 未结 3 410
慢半拍i
慢半拍i 2021-01-18 10:20

I need to render the results of google.maps.places.Autocomplete in a custom way, instead of the default drop down menu.

Is there any way I can use the G

相关标签:
3条回答
  • 2021-01-18 10:47

    Try the AutocompleteService class:

    "You can use the AutocompleteService class to retrieve the query or place prediction data returned from the Autocomplete service. Calling either the getPlacePredictions() or getQueryPredictions() methods will return an array of five prediction objects of the form:"

    0 讨论(0)
  • 2021-01-18 11:01

    Have you explored the Autocomplete function of the Places API webservice? That appears to be what you're looking for.

    0 讨论(0)
  • 2021-01-18 11:03

    I believe this is the link that @jegnag meant to include.

    https://developers.google.com/maps/documentation/javascript/places-autocomplete#place_autocomplete_service

    You can access the array of results (places in addition to suggested search terms), you can even add your own custom results to this array, and display everything however you choose.

    0 讨论(0)
提交回复
热议问题