Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
273 changes: 273 additions & 0 deletions docs/content/docs/reference/components/google-maps.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
---
title: "Google Maps"
description: "Google Maps is a widely used mapping service by Google, offering free and feature-rich navigation, location discovery, and real-time traffic updates accessible through web browsers and mobile apps."
---


Categories: Helpers


Type: googleMaps/v1

<hr />



## Connections

Version: 1


### api_key

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| api_token | API Key | STRING | API key that can be found at Google Cloud Console. | true |





<hr />


## Actions


### Get Route
Name: getRoute

`Get route between inputted origin and destination.`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| origin | Origin | STRING | Specify address of origin in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces. | true |
| destination | Destination | STRING | Specify address of destination in accordance with the format used by the national postal service of the country concerned. Additional address elements such as business names and unit, suite or floor numbers should be avoided. Street address elements should be delimited by spaces. | true |
| travelMode | Travel Mode | STRING <details> <summary> Options </summary> DRIVE, BICYCLE, WALK, TRANSIT </details> | Desired travel mode. | false |
| routingPreference | Routing Preference | STRING <details> <summary> Options </summary> TRAFFIC_UNAWARE, TRAFFIC_AWARE, TRAFFIC_AWARE_OPTIMAL </details> | Routing preference of the route. | false |
| computeAlternativeRoutes | Compute Alternative Routes | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether alternative routes should be computed. | false |
| avoidTolls | Avoid Tolls | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid tolls. | false |
| avoidHighways | Avoid Highways | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid highways. | false |
| avoidFerries | Avoid Ferries | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid ferries. | false |
| units | Units | STRING <details> <summary> Options </summary> METRIC, IMPERIAL </details> | Metrics of the route | false |

#### Example JSON Structure
```json
{
"label" : "Get Route",
"name" : "getRoute",
"parameters" : {
"origin" : "",
"destination" : "",
"travelMode" : "",
"routingPreference" : "",
"computeAlternativeRoutes" : false,
"avoidTolls" : false,
"avoidHighways" : false,
"avoidFerries" : false,
"units" : ""
},
"type" : "googleMaps/v1/getRoute"
}
```

#### Output



Type: OBJECT


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| routes | ARRAY <details> <summary> Items </summary> [&#123;[&#123;INTEGER\(distanceMeters), STRING\(duration), STRING\(staticDuration), &#123;STRING\(encodedPolyline)&#125;\(polyline), &#123;&#123;NUMBER\(latitude), NUMBER\(longitude)&#125;\(latLng)&#125;\(startLocation), &#123;&#123;NUMBER\(latitude), NUMBER\(longitude)&#125;\(latLng)&#125;\(endLocation), []\(steps), &#123;&#123;STRING\(text)&#125;\(distance), &#123;STRING\(text)&#125;\(duration), &#123;STRING\(text)&#125;\(staticDuration)&#125;\(localizedValues)&#125;]\(legs), INTEGER\(distanceMeters), STRING\(duration), STRING\(staticDuration), &#123;&#123;&#125;\(encodedPolyline)&#125;\(polyline), STRING\(description), &#123;&#123;NUMBER\(latitude), NUMBER\(longitude)&#125;\(low), &#123;NUMBER\(latitude), NUMBER\(longitude)&#125;\(high)&#125;\(viewport), &#123;&#125;\(travelAdvisory), &#123;&#123;STRING\(text)&#125;\(distance), &#123;STRING\(text)&#125;\(duration), &#123;STRING\(text)&#125;\(staticDuration)&#125;\(localizedValues), [STRING]\(routeLabels), &#123;&#125;\(polylineDetails)&#125;] </details> | Routes from origin to destination. |
| geocodingResults | OBJECT <details> <summary> Properties </summary> &#123;&#125; </details> | |




#### Output Example
```json
{
"routes" : [ {
"legs" : [ {
"distanceMeters" : 1,
"duration" : "",
"staticDuration" : "",
"polyline" : {
"encodedPolyline" : ""
},
"startLocation" : {
"latLng" : {
"latitude" : 0.0,
"longitude" : 0.0
}
},
"endLocation" : {
"latLng" : {
"latitude" : 0.0,
"longitude" : 0.0
}
},
"steps" : [ ],
"localizedValues" : {
"distance" : {
"text" : ""
},
"duration" : {
"text" : ""
},
"staticDuration" : {
"text" : ""
}
}
} ],
"distanceMeters" : 1,
"duration" : "",
"staticDuration" : "",
"polyline" : {
"encodedPolyline" : { }
},
"description" : "",
"viewport" : {
"low" : {
"latitude" : 0.0,
"longitude" : 0.0
},
"high" : {
"latitude" : 0.0,
"longitude" : 0.0
}
},
"travelAdvisory" : { },
"localizedValues" : {
"distance" : {
"text" : ""
},
"duration" : {
"text" : ""
},
"staticDuration" : {
"text" : ""
}
},
"routeLabels" : [ "" ],
"polylineDetails" : { }
} ],
"geocodingResults" : { }
}
```


### Nearby Search
Name: nearbySearch

`Action takes one or more place types, and returns a list of matching places within the specified area.`

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| includedTypes | Included | ARRAY <details> <summary> Items </summary> [STRING\($keyword)] </details> | Keywords which will be used for filtering. | true |
| address | Address | STRING | Center address of the nearby search. | true |
| radius | Radius | NUMBER | Radius of circle area that will be searched. The radius must be between 0.0 meters and 50000.0 meters inclusive. | true |

#### Example JSON Structure
```json
{
"label" : "Nearby Search",
"name" : "nearbySearch",
"parameters" : {
"includedTypes" : [ "" ],
"address" : "",
"radius" : 0.0
},
"type" : "googleMaps/v1/nearbySearch"
}
```

#### Output



Type: ARRAY


Items Type: OBJECT


#### Properties
| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| location | OBJECT <details> <summary> Properties </summary> &#123;NUMBER\(latitude), NUMBER\(longitude)&#125; </details> | Location of the place. |
| businessStatus | STRING | Business status of the place. |
| displayName | OBJECT <details> <summary> Properties </summary> &#123;STRING\(text), STRING\(languageCode)&#125; </details> | Display name of the place. |
| accessibilityOptions | OBJECT <details> <summary> Properties </summary> &#123;BOOLEAN\(wheelchairAccessibleParking), BOOLEAN\(wheelchairAccessibleEntrance), BOOLEAN\(wheelchairAccessibleRestroom), BOOLEAN\(wheelchairAccessibleSeating)&#125; </details> | Accessibility options of the place. |
| googleMapsLinks | OBJECT <details> <summary> Properties </summary> &#123;STRING\(directionsUri), STRING\(placeUri), STRING\(writeAReviewUri), STRING\(reviewsUri), STRING\(photosUri)&#125; </details> | Google Maps links connected to the place. |





#### Output Example
```json
[ {
"location" : {
"latitude" : 0.0,
"longitude" : 0.0
},
"businessStatus" : "",
"displayName" : {
"text" : "",
"languageCode" : ""
},
"accessibilityOptions" : {
"wheelchairAccessibleParking" : false,
"wheelchairAccessibleEntrance" : false,
"wheelchairAccessibleRestroom" : false,
"wheelchairAccessibleSeating" : false
},
"googleMapsLinks" : {
"directionsUri" : "",
"placeUri" : "",
"writeAReviewUri" : "",
"reviewsUri" : "",
"photosUri" : ""
}
} ]
```




<hr />

# Additional Instructions

## Connection Setup

### Enable Geocoding API, Places API and Routes API

1. In the [Google Cloud Console](https://console.cloud.google.com/), select your project.
2. Click this icon.
3. Click on **APIs & Services**.
4. Enter **Geocoding API** in search bar.
5. Click on **Geocoding API**.
6. Click on **Enable**.
7. Enter **Places API** in search bar.
8. Click on **Places API**.
9. Click on **Enable**.
10. Enter **Routes API** in search bar.
11. Click on **Routes API**.
12. Click on **Enable**.


<div style={{ position: 'relative', height:0, width: '100%', overflow: 'hidden', zIndex: 99999, boxSizing: 'border-box', paddingBottom: 'calc(50.05219207% + 32px)'}}>
<iframe src="https://www.guidejar.com/embed/8f4f75b3-b4f9-43bd-a50e-6344dc2d298d?type=1&controls=on" width="100%" height="100%" style={{height:'100%', position:'absolute', inset:0}} allowfullscreen frameborder="0"></iframe>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ interface Encoder {
* @return
*/
String base64EncodeToString(byte[] bytes);

/**
*
* @param string
* @return
*/
String urlEncode(String string);

}

/**
Expand Down
1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ dependencies {
implementation(project(":server:libs:modules:components:google:google-drive"))
implementation(project(":server:libs:modules:components:google:google-forms"))
implementation(project(":server:libs:modules:components:google:google-mail"))
implementation(project(":server:libs:modules:components:google:google-maps"))
implementation(project(":server:libs:modules:components:google:google-meet"))
implementation(project(":server:libs:modules:components:google:google-sheets"))
implementation(project(":server:libs:modules:components:google:google-slides"))
Expand Down
1 change: 1 addition & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ dependencies {
implementation(project(":server:libs:modules:components:google:google-drive"))
implementation(project(":server:libs:modules:components:google:google-forms"))
implementation(project(":server:libs:modules:components:google:google-mail"))
implementation(project(":server:libs:modules:components:google:google-maps"))
implementation(project(":server:libs:modules:components:google:google-meet"))
implementation(project(":server:libs:modules:components:google:google-sheets"))
implementation(project(":server:libs:modules:components:google:google-slides"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version="1.0"

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2025 ByteChef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.google.maps;

import static com.bytechef.component.definition.ComponentDsl.component;
import static com.bytechef.component.definition.ComponentDsl.tool;

import com.bytechef.component.ComponentHandler;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.component.google.maps.action.GoogleMapsGetRouteAction;
import com.bytechef.component.google.maps.action.GoogleMapsNearbySearchAction;
import com.bytechef.component.google.maps.connection.GoogleMapsConnection;
import com.google.auto.service.AutoService;

/**
* @author Nikolina Spehar
*/
@AutoService(ComponentHandler.class)
public class GoogleMapsComponentHandler implements ComponentHandler {

private static final ComponentDefinition COMPONENT_DEFINITION = component("googleMaps")
.title("Google Maps")
.description(
"Google Maps is a widely used mapping service by Google, offering free and feature-rich navigation, " +
"location discovery, and real-time traffic updates accessible through web browsers and mobile apps.")
.icon("path:assets/google-maps.svg")
.categories(ComponentCategory.HELPERS)
.connection(GoogleMapsConnection.CONNECTION_DEFINITION)
.clusterElements(
tool(GoogleMapsGetRouteAction.ACTION_DEFINITION),
tool(GoogleMapsNearbySearchAction.ACTION_DEFINITION))
.actions(
GoogleMapsGetRouteAction.ACTION_DEFINITION,
GoogleMapsNearbySearchAction.ACTION_DEFINITION);

@Override
public ComponentDefinition getDefinition() {
return COMPONENT_DEFINITION;
}
}
Loading