2017-25 © Pedro Peláez
 

library google-address

Google Place interface for address form.

image

atk4/google-address

Google Place interface for address form.

  • Friday, June 22, 2018
  • by romaninsh
  • Repository
  • 3 Watchers
  • 0 Stars
  • 43 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 760 % Grown

The README.md

ATK UI implements a high-level User Interface for Web App - such as Admin System. One of the most common things for the Admin system is a log-in screen., (*1)

This add-on will transform a form input field into a Google place autocomplete field. Once value is select in Goolge autocomplete, it will automatically populate other form input field., (*2)

Installation

Install through composer composer require atk4/google-address, (*3)

Example

Start typing in order to start gettings results from Google place api., (*4)

autocomplete, (*5)

Then form field is populate automatically when a place is select from the dropdown., (*6)

form, (*7)

Usage

First setup your Google Api developer key within the map loader., (*8)

JsLoader::setGoogleApiKey('YOUR_API_KEY');

Simply add the google-address form control in your form., (*9)

$f->addControl('map_search', [new atk4\GoogleAddress\AddressLookup()]);

When added to the form, the control will try to populate other inputs in form with value return by the Places Api. For this to happen, a control name must match any of the Types name return by Google Places api., (*10)

Consider adding this control to your form:, (*11)

$street = $f->addControl(Type::STREET_NUMBER);

When a return value from the Places autocomplete dropdown is select, then $street control value will be set
using result from the Place Api., (*12)

Specifying value to specific control.

AddressLookup::onCompleteSet(Control $formControl, Build $builder): self

This method will try to set the $formControl with value return by $builder when user select a place., (*13)

Example

Let's say form has a control for which you would like to set its value with return results from the Places api. Furthermore, you would like to use multiple values from Places Api in order to set the control value with., (*14)

For example the street_number and the route value., (*15)

/** @var AddressLookup $ga */
$ga = $form->addControl('map_search', [AddressLookup::class]);
$address = $form->addControl('address');

// '444 street name'
$a_value = Build::with(Value::of(Type::STREET_NUMBER))->concat(Value::of(Type::ROUTE))->glueWith(' ');

$ga->onCompleteSet($address, $a_value);

See demos file for more information., (*16)

The Versions

22/06 2018

dev-develop

dev-develop https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui

22/06 2018

dev-atk4/google-address/issue/#1

dev-atk4/google-address/issue/#1 https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui

11/05 2018

1.0.3

1.0.3.0 https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui

11/05 2018

1.0.2

1.0.2.0 https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui

30/04 2018

1.0.1

1.0.1.0 https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui

30/04 2018

1.0.0

1.0.0.0 https://github.com/atk4/google-address

Google Place interface for address form.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework data agile atk4 agile ui