How to implement Google Maps + Places Autocomplete in Ionic?


#1

Hi everyone, I’m doing an application with Geolocation and Google Maps. I’m trying to make a “location” selector with Ionic Native Plugin (https://ionicframework.com/docs/native/google-maps/) but I need to place a “searchbar” in the top of the map to search an address (#, street, city).

I read a lot of blogs and also asked in Github but it seems that Places searchbar is not currently supported, so Instead of using Ionic Native Plugin I tried to use Google Maps API in Javascript but it does not shows the map in a real device. I’m a little desperate because I can’t believe there are no examples of this in the internet…

Can you help me?


#2

Hi,

There are a lot of resources on how to build an Ionic app with google maps. One way is to use the JS library of google maps: https://www.joshmorony.com/ionic-2-how-to-use-google-maps-geolocation-video-tutorial/ and the other would be to use the native plugin: https://codeburst.io/native-google-maps-and-geolocation-ionic-fe635a00249d

But you can’t use google places with the google maps plugin, so you either use only the JS google maps library or use the plugin for the map and the JS library for the search autocompleate.
Here is a similar question asked on this forum: Ionic 2 - Google places and Autocomplete

Hope that helps!
cheers