Google Maps API : Where do we go from here ?

Pierre Mériau
Algolia Stories
Published in
4 min readJul 5, 2018

--

On May the 9th, the Google monolith announced a massive price increase for several of its APIs, which were until then free or at least benefited from very advantageous pricing. Quite a discreet announcement, with a beginning on June 11.

At Malt, like many other marketplaces, we mainly use the Places API to locate our freelancers through the search field by the city, country or region in order to suggest relevant results.

As an indication, the choice to continue using Google Maps would be equivalent to a salary for us according to the new rates (~350 000 requests / month mainly on the Places API).

A whole new world

Since no one wanted to resign to offset this expense, we benchmarked several solutions. The idea being to find the best balance between pricing, ease of implementation (due to the deadline) and the services offered.

After a quick look at MapBox and Algolia, we finally decided to retain the latter.

Their Places API offers all the services currently used and the associated javascript plugin for autocomplete are almost similar to that of Google.

A read-through of the documentation later, we were ready to say “goodbye” to Google and “Stop, don’t do it” to Jeremy who had started writing a letter of resignation in a great deed sacrifice.

Time to transition

Making the two services, Google and Algolia, coexist was not complicated. At Malt, we are more fans of features-flipping than features branching (Say what…? Answer here).

Thus, during the development time, the idea was not to go back over all of the Malt localization search forms (home, header, profile…)and adapt them to the Algolia API. We just had to create two distinct javascript modules, one including the current implementation linked to Google Maps and the other dedicated to Algolia Places and switch from one to the other to test the consistency of the two services and their transparency for the end user.

window.GEOLOCATION_PROVIDER being set to’google’ or’algolia’ according to our feature-flipping system

Algolia Places: finding familiar ground

For those who have already used Google’s js Places library, adapting to Algolia will not require any effort. The principle is the same: target an Input (your search field) in your document and create a new instance of the plugin based on this element.

It should be noted that Algolia Places has its own npm module.

The most interesting additional options that can be provided at plugin initialization are :

  • The locale, you do not want to show english results to your French users.
  • A template for suggestion items. Algolia offers a basic list of items with an icon, size… Which aren’t necessarily connected with your front-end guidelines.
  • One filter per type of result:’city’,’country’…

As mentioned above, the idea is to adapt Algolia’s API results to our existing search forms without having to modify them. The Algolia suggestion model being significantly different from Google Maps Places, a small mapping is required.

Elementary my dear Watson

The transition from Google to Algolia is not expensive in terms of development, some points to remember :

  • dedicated npm module
  • similar principle of targeting an input for the instantiation of the plugin
  • a slight binding for existing form fields
  • markup customization parameter used for suggestions

Nothing too complicated… So, really, Jeremy, you can stop with that resignation letter.

Algolia : action — reaction

If you’re still skeptical about moving from Google to a smaller company for such an important feature to your service, the Algolia Places technical team is pretty responsive.

And a fixed bug!

Their Software Engineer answered very quickly to the few questions and bugs that we reported back to them. They are aware of the demand caused by the Google annoucment and are able to offer an adequate service to all those who have not yet fired one of their employees.

For our part, we only have one missing service from Google Maps Places: the search by region. We are often confronted with a search like: “Developer — Auvergne-Rhône-Alpes” for example. Currently, Algolia does not allow this. It’s on their roadmap but not for June 11th unfortunately.

And you?

If you are a freelancer and are more particularly on Malt, don’t hesitate to highlight the skills related to a change as important as the one involved by the Google annoucment. So remember to update your profile by adding keywords like Algolia, OpenStreetMaps, MapBox… These are the terms that will certainly interest customers who have chosen to move way from Google Maps.

And if you are a customer and the switch from Google Maps to another service is one of your priorities, know that you can find several freelancers able to fulfill this mission for you on Malt.

Also, ecstatic at not having had to fire anyone, we continue recruiting people, that’s happening over here!

--

--