Capacitor Full App - Ionic Angular
  • What is Capacitor Full App - Ionic Angular?
  • Understand the Frameworks
  • Template Highlights
  • Setup
    • Initial Setup
  • Running the app
  • Building App on device
  • Deploying app as PWA
    • Deploy PWA on Firebase
  • How to use this template
    • Two way to use this Template
  • Removing a Page / Component
  • Removing a plugin
  • Extra
    • Troubleshooting
    • FAQ
  • Changelog
  • Features
    • Startup Features
      • Layouts
      • Firebase
      • Addons
        • Globalization - Translation
        • Content Loaders
        • Custom Fonts
        • Infinite Scroll
        • Pull to Refresh
        • List Re-ordering
        • Date Time Pickers
        • Settings
      • Login & Signups
      • Sidemenu Layouts
      • Wordpress
        • How to integrate
      • Video Playlist
      • Grid and List Layouts
      • Chat Lists & Chat Pages
    • Pro Features
      • Pro Addons
        • AdMob
          • Integration
          • Setting up Google Admob
        • Music Player
        • Push Notifications
        • Local Notifications
        • Device
        • Clipboard
        • Social Login
        • In-App Browser
        • Sweet Alerts
        • Social Sharing
        • Google Places
        • Google Autocomplete
        • Image Cropper
      • Phaser Game Framework
      • WooCommerce
      • Payment Gateways
    • Others
      • Adding Icon and Splash
Powered by GitBook
On this page

Was this helpful?

  1. Features
  2. Pro Features
  3. Pro Addons

Google Autocomplete

Implement a search bar with autocomplete functionality that matches places catalogued by Google

PreviousGoogle PlacesNextImage Cropper

Last updated 5 years ago

Was this helpful?

Autocomplete is used in various apps for finding locations on a map . E.g. We use autocomplete in Uber to find our destination, to find a place on Google Maps etc.

Capacitor Full App implements autocomplete using AGM - Angular google Maps.

Import the MapsAPILoader with

import { MapsAPILoader } from '@agm/core';

Autocomplete can be simply implemented using

const autocomplete = new google.maps.places.Autocomplete(nativeHomeInputBox, {
  types: ['address']
});
autocomplete.addListener('place_changed', () => {
  this.ngZone.run(() => {
    const place: google.maps.places.PlaceResult = autocomplete.getPlace();
    this.query = place['formatted_address'];
  });
});

Once a place is selected from the list, place variable in the above function return a response as shown below. You can choose formatted_address for all general purposes.