Inspiration

What if your map could hold a conversation? Google Places Text Search paired with a chat interface transforms maps into intelligent, conversational experiences - allowing users to ask geospatial, natural language questions like:

✔️ “What's the best dim sum in Vancouver?” ✔️ “Good activities for kids in the summer near Victoria” ✔️ “Best date night ideas in Bunaby”

Google Text Search

What it does

Google Maps Chat brings maps to life - making a static Google Map intelligent, and conversational. By connecting to Google's vast database of addresses, businesses and points of interest using Google Places Text Search, we built an application that combines maps, navigation, and search to deliver spatially aware answers.

How we built it

As its name suggests, Google Maps Chat features a simple chat UI (text input + message history) built on the Chat UI Kit library. When the user types a query and hits enter, we use a typing effect to create a realistic conversational chat experience.

Chat UI

We then called the Google Text Search API with the user's query string. The response includes a list of matching places with their names, types, ratings, and address, which we display on a side bar and on the map.

Challenges we ran into

Replaying the query character by character felt too robotic, so we introduced typing delays and animated typing indicators to better mimic the natural pauses of a real conversation, making the chat interface feel more life like. This was done by recursively calling the setTimeout() method with typeCharacter() paired with a randomSpeed value. Each time setTimeout() is called, the value of index is incremented by 1 until its value reaches the length of the text string, signaling that the entire text has been displayed. A more detailed explanation including full source code can be found in our blog post.

Accomplishments that we're proud of

Most LLMs treat mapping as an afterthought. I'm delighted that we could use the Google Maps Text Search API to bring mapping to the forefront of conversational UI.

What we learned

Not all Chat UI libraries are built the same. Choose one that lets you customize key elements without spending too much time on configuration.

What's next for Google Maps Chat

The team at Afi Labs is building white labelled versions of Google Maps Chat for clients in the hospitality and travel sectors.

Built With

Share this project:

Updates