Hi guys.
I need to show the distance between my place( a hotel)and the nearest metro station and bus station? Can i do that with the google maps api?
How do I do it?
Hi guys.
I need to show the distance between my place( a hotel)and the nearest metro station and bus station? Can i do that with the google maps api?
How do I do it?
Yep, totally possible with the Google Maps API. The easiest way is to store both the hotel and the stations as âgeographic addressâ data types, then use Bubbleâs built-in distance calculation.
For more control, use the API Connector with Googleâs Distance Matrix API.
It will give you a list of nearby points of interest from your location by returning valuable data, like distance, time to travel, and other useful logistics.
Its very easy, use AI to build a ApI call for your exact need and ask it to give you curl example.
Then just add it to your api connect also ask ai what option need to be dunamic. And use those dynamic option to fill your specific details.
If you like i can integrate it for you, for free
Yes â you can do this with Google Maps API, but the right approach depends on what you mean by ânearestâ.
If you want the nearest metro station and bus station automatically, youâll typically use Google Places API (Nearby Search) to find the closest âsubway_stationâ and âbus_stationâ around your hotelâs location, then use Google Distance Matrix API (or Directions API) to calculate the distance (and optionally travel time). In Bubble, the clean setup is:
Store your hotel location as a Geographic address (e.g., Hotel's address).
Call Places Nearby Search with:
location = hotel lat/lng
rankby=distance (so Google returns nearest first)
type=subway_station (for metro)
then do a second call with type=bus_station (for bus)
From each response, take the first result (thatâs the nearest), save:
station name
station place_id
station lat/lng
Now calculate distance:
Quick/simple: use Bubbleâs built-in Hotel's address:distance from Station's address (straight-line distance).
Accurate (walking/driving + time): call Distance Matrix API with:
origins = hotel lat/lng
destinations = station lat/lng
mode=walking (or driving/transit if supported)
Display returned distance.text and duration.text.
thanks a lot guys. so, I need to work with a different Google API (key) called Googole Places API. Did i get it right?
yes sir