On: February 06, 2018 In: Google Chrome Extensions Comments: 6

Recently I was working on a project that relied heavily on location data. It required entering addresses, over and over again. Country, state, street address, city, zip code, etc… I was thinking that there must be a better way. Turns out there is: Google Autocomplete!

I am sure you have seen stuff on the web that looks something like this:

Google Places Autocomplete advantages

This type of address input has a few advantages over allowing the user to type whatever they want. First, it gives you valid addresses from the Google Maps API. Second, it speeds up the process for the user because they don’t have to type out all the address fields. It even gives suggestions based on their location! And finally, it is just pretty darn cool.

Now with our Google Places Autocomplete Plugin for Oracle Application Express (APEX) , you can get up and running with this in just a few minutes.

Features

  • Ability to map address components to multiple items.
  • Ability to limit the search to different address types such as addresses, establishments, cities, and more!
  • Interactive Grid (Grid example)
  • Option to return abbreviated form of Address, State, and Country.
  • Option to return address in JSON format. (JSON example)
  • Suggest addresses closest to user’s current geolocation.

(Grid example)

(JSON example)

Google Places Autocomplete saved me a lot of time

Using this feature cut my address input time from 12 seconds to 3 seconds on average. It may not seem like a lot, but when repeating this process, it allows users to complete the task in only one quarter of the time that it usually does. That is a huge improvement in terms of time and also just the overall experience in general.

A few tips on installation of this plugin

To install this plugin, go to our github:  https://github.com/insum-labs/apex-plugin-google-places-autocomplete
First download the repository. Then open APEX and go to the app you wish to install it in. Import the plugin file named “item_type_plugin_com_insum_placecomplete.sql”. After the import is done, it will ask you for an API key which is required. You can acquire one at https://developers.google.com/maps/documentation/javascript/get-api-key. That is all that it takes!

Finally, if there are any issues or enhancements you would like to request, please submit them on the github page and we will respond to them in a timely manner!

 

Subscribe

Get our latest content delivered to your inbox and stay informed on our upcoming educational events.

Related Content

Simplified E-Business Suite Development -Think Oracle APEX

When it comes to extending applications in the Oracle E-Business Suite Environment, EBS Developers and their managers have been presented with some difficult options...

Learn More
Autonomous Blockchain, It’s Almost Here!

ICYMI (in case you missed it), Oracle is having a special live webcast on July 16, 2018. After several false expectations from the media,...

Learn More
City of Montreal Recognizes Insum with Intercultural Award

The City of Montreal Recognizes Insum with an Intercultural Award On April 17th, 2018, the City of Montreal honored Insum with the Abe-Limonchik intercultural...

Learn More
Kscope Highlights – Ideas, Friends, Fun

Kscope 2018 was held in Orlando, Fl. from June 10 to June 14  Seeing as only a fraction of the total APEX community can actually...

Learn More
Power Ranking Oracle APEX 18.1 New Features – May

FINALLY! After months of anticipation, Oracle Application Express (APEX) version 18.1 has arrived! Taking a look at the new features included definitely makes it...

Learn More

6 Comments:

    • Scott Wesley
    • March 22, 2018
    • Reply

    This is a very neat plugin, but I tried modifying the URL to restrict to only locations within a certain radius, but I’m obviously doing it wrong.
    l_js_params := ‘?key=’ || l_api_key || ‘&libraries=places&location=-31,115&radius=5000’;
    https://developers.google.com/places/web-service/autocomplete#place_types

    Do you have any advice?

      • Neil Fernandez
      • April 06, 2018
      • Reply

      Hi Scott,

      You are looking at where we retrieve the Google Places library javascript file : https://developers.google.com/maps/documentation/javascript/places
      Replacing the values in l_js_params will not make the request that you are looking for. The next step we do is add this library to our plugin:

      apex_javascript.add_library
      (p_name => 'js' || l_js_params
      ,p_directory => 'https://maps.googleapis.com/maps/api/'
      ,p_skip_extension => true);

      This loads the js library. Making a call to https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters will return XML or JSON, not a javascript library.

      To get the result you are looking for, you would have to modify the jquery.ui.autoComplete file and modify the autocomplete object, or you can run javascript on the page after the autocomplete object is initialized to do this. Could you please add this to our github as feature request? https://github.com/insum-labs/apex-plugin-google-places-autocomplete
      We will try to add it to an upcoming release as a built in option.

      Best,
      Neil

    • Ali Mehmet
    • April 06, 2018
    • Reply

    this is very cool indeed – will it work for UK addresses? What other data can be retrieved along with the address?

      • Neil Fernandez
      • April 06, 2018
      • Reply

      Hi Ali,

      Yes this will work for UK addresses. Only thing is, address terminology is different for different countries. What we consider city may be considered something else to Google.

      For this reason, we return the JSON that is returned from Google to allow the developers to parse it for these situations. Please use this option for these scenarios to do as you please with the data returned.

      No other data is available currently in our plugin, we allow the user to see the address_components portion of the Google Autocomplete object. In our next release we will allow the user to get the whole object, and do as they would like to retrieve other information such as place id, opening hours for business, etc. Everything that is available here: https://developers.google.com/maps/documentation/javascript/places#place_details

      Hope this helps,
      Neil

    • Niel van Schalkwyk
    • April 23, 2018
    • Reply

    Hi
    I’ve managed to get it to work in the Interactive Grid, and all the necessary fields are displayed on the screen when an address is entered. But when I save it, the latitude and longitude fields are nullified and does not save to the DB. Any idea what I might be doing wrong?
    Niel

      • Neil Fernandez
      • June 18, 2018
      • Reply

      Hi Niel,

      Thank you for pointing this out. Will add this to the bug list and hopefully have it fixed in our next release at the end of the week.

      Best,
      Neil

Leave reply:

Your email address will not be published. Required fields are marked *