Skip to content

Commit d895d48

Browse files
2827 - Google Maps component added
1 parent 8430cbf commit d895d48

File tree

18 files changed

+7985
-0
lines changed

18 files changed

+7985
-0
lines changed
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
---
2+
title: "Google Maps"
3+
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."
4+
---
5+
6+
7+
Categories: Helpers
8+
9+
10+
Type: googleMaps/v1
11+
12+
<hr />
13+
14+
15+
16+
## Connections
17+
18+
Version: 1
19+
20+
21+
### api_key
22+
23+
#### Properties
24+
25+
| Name | Label | Type | Description | Required |
26+
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
27+
| api_token | API Key | STRING | API key that can be found at Google Cloud Console. | true |
28+
29+
30+
31+
32+
33+
<hr />
34+
35+
36+
## Actions
37+
38+
39+
### Get Route
40+
Name: getRoute
41+
42+
`Get route between inputted origin and destination.`
43+
44+
#### Properties
45+
46+
| Name | Label | Type | Description | Required |
47+
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
48+
| 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 |
49+
| 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 |
50+
| travelMode | Travel Mode | STRING <details> <summary> Options </summary> DRIVE, BICYCLE, WALK, TRANSIT </details> | Desired travel mode. | false |
51+
| routingPreference | Routing Preference | STRING <details> <summary> Options </summary> TRAFFIC_UNAWARE, TRAFFIC_AWARE, TRAFFIC_AWARE_OPTIMAL </details> | Routing preference of the route. | false |
52+
| computeAlternativeRoutes | Compute Alternative Routes | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether alternative routes should be computed. | false |
53+
| avoidTolls | Avoid Tolls | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid tolls. | false |
54+
| avoidHighways | Avoid Highways | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid highways. | false |
55+
| avoidFerries | Avoid Ferries | BOOLEAN <details> <summary> Options </summary> true, false </details> | Whether to avoid ferries. | false |
56+
| units | Units | STRING <details> <summary> Options </summary> METRIC, IMPERIAL </details> | Metrics of the route | false |
57+
58+
#### Example JSON Structure
59+
```json
60+
{
61+
"label" : "Get Route",
62+
"name" : "getRoute",
63+
"parameters" : {
64+
"origin" : "",
65+
"destination" : "",
66+
"travelMode" : "",
67+
"routingPreference" : "",
68+
"computeAlternativeRoutes" : false,
69+
"avoidTolls" : false,
70+
"avoidHighways" : false,
71+
"avoidFerries" : false,
72+
"units" : ""
73+
},
74+
"type" : "googleMaps/v1/getRoute"
75+
}
76+
```
77+
78+
#### Output
79+
80+
81+
82+
Type: OBJECT
83+
84+
85+
#### Properties
86+
87+
| Name | Type | Description |
88+
|:------------:|:------------:|:-------------------:|
89+
| 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. |
90+
| geocodingResults | OBJECT <details> <summary> Properties </summary> &#123;&#125; </details> | |
91+
92+
93+
94+
95+
#### Output Example
96+
```json
97+
{
98+
"routes" : [ {
99+
"legs" : [ {
100+
"distanceMeters" : 1,
101+
"duration" : "",
102+
"staticDuration" : "",
103+
"polyline" : {
104+
"encodedPolyline" : ""
105+
},
106+
"startLocation" : {
107+
"latLng" : {
108+
"latitude" : 0.0,
109+
"longitude" : 0.0
110+
}
111+
},
112+
"endLocation" : {
113+
"latLng" : {
114+
"latitude" : 0.0,
115+
"longitude" : 0.0
116+
}
117+
},
118+
"steps" : [ ],
119+
"localizedValues" : {
120+
"distance" : {
121+
"text" : ""
122+
},
123+
"duration" : {
124+
"text" : ""
125+
},
126+
"staticDuration" : {
127+
"text" : ""
128+
}
129+
}
130+
} ],
131+
"distanceMeters" : 1,
132+
"duration" : "",
133+
"staticDuration" : "",
134+
"polyline" : {
135+
"encodedPolyline" : { }
136+
},
137+
"description" : "",
138+
"viewport" : {
139+
"low" : {
140+
"latitude" : 0.0,
141+
"longitude" : 0.0
142+
},
143+
"high" : {
144+
"latitude" : 0.0,
145+
"longitude" : 0.0
146+
}
147+
},
148+
"travelAdvisory" : { },
149+
"localizedValues" : {
150+
"distance" : {
151+
"text" : ""
152+
},
153+
"duration" : {
154+
"text" : ""
155+
},
156+
"staticDuration" : {
157+
"text" : ""
158+
}
159+
},
160+
"routeLabels" : [ "" ],
161+
"polylineDetails" : { }
162+
} ],
163+
"geocodingResults" : { }
164+
}
165+
```
166+
167+
168+
### Nearby Search
169+
Name: nearbySearch
170+
171+
`Action takes one or more place types, and returns a list of matching places within the specified area.`
172+
173+
#### Properties
174+
175+
| Name | Label | Type | Description | Required |
176+
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
177+
| includedTypes | Included | ARRAY <details> <summary> Items </summary> [STRING\($keyword)] </details> | Keywords which will be used for filtering. | true |
178+
| address | Address | STRING | Center address of the nearby search. | true |
179+
| 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 |
180+
181+
#### Example JSON Structure
182+
```json
183+
{
184+
"label" : "Nearby Search",
185+
"name" : "nearbySearch",
186+
"parameters" : {
187+
"includedTypes" : [ "" ],
188+
"address" : "",
189+
"radius" : 0.0
190+
},
191+
"type" : "googleMaps/v1/nearbySearch"
192+
}
193+
```
194+
195+
#### Output
196+
197+
198+
199+
Type: ARRAY
200+
201+
202+
Items Type: OBJECT
203+
204+
205+
#### Properties
206+
| Name | Type | Description |
207+
|:------------:|:------------:|:-------------------:|
208+
| location | OBJECT <details> <summary> Properties </summary> &#123;NUMBER\(latitude), NUMBER\(longitude)&#125; </details> | Location of the place. |
209+
| businessStatus | STRING | Business status of the place. |
210+
| displayName | OBJECT <details> <summary> Properties </summary> &#123;STRING\(text), STRING\(languageCode)&#125; </details> | Display name of the place. |
211+
| accessibilityOptions | OBJECT <details> <summary> Properties </summary> &#123;BOOLEAN\(wheelchairAccessibleParking), BOOLEAN\(wheelchairAccessibleEntrance), BOOLEAN\(wheelchairAccessibleRestroom), BOOLEAN\(wheelchairAccessibleSeating)&#125; </details> | Accessibility options of the place. |
212+
| 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. |
213+
214+
215+
216+
217+
218+
#### Output Example
219+
```json
220+
[ {
221+
"location" : {
222+
"latitude" : 0.0,
223+
"longitude" : 0.0
224+
},
225+
"businessStatus" : "",
226+
"displayName" : {
227+
"text" : "",
228+
"languageCode" : ""
229+
},
230+
"accessibilityOptions" : {
231+
"wheelchairAccessibleParking" : false,
232+
"wheelchairAccessibleEntrance" : false,
233+
"wheelchairAccessibleRestroom" : false,
234+
"wheelchairAccessibleSeating" : false
235+
},
236+
"googleMapsLinks" : {
237+
"directionsUri" : "",
238+
"placeUri" : "",
239+
"writeAReviewUri" : "",
240+
"reviewsUri" : "",
241+
"photosUri" : ""
242+
}
243+
} ]
244+
```
245+
246+
247+
248+
249+
<hr />
250+
251+
# Additional Instructions
252+
253+
## Connection Setup
254+
255+
### Enable Geocoding API, Places API and Routes API
256+
257+
1. In the [Google Cloud Console](https://console.cloud.google.com/), select your project.
258+
2. Click this icon.
259+
3. Click on **APIs & Services**.
260+
4. Enter **Geocoding API** in search bar.
261+
5. Click on **Geocoding API**.
262+
6. Click on **Enable**.
263+
7. Enter **Places API** in search bar.
264+
8. Click on **Places API**.
265+
9. Click on **Enable**.
266+
10. Enter **Routes API** in search bar.
267+
11. Click on **Routes API**.
268+
12. Click on **Enable**.
269+
270+
271+
<div style={{ position: 'relative', height:0, width: '100%', overflow: 'hidden', zIndex: 99999, boxSizing: 'border-box', paddingBottom: 'calc(50.05219207% + 32px)'}}>
272+
<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>
273+
</div>

server/apps/server-app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ dependencies {
215215
implementation(project(":server:libs:modules:components:google:google-drive"))
216216
implementation(project(":server:libs:modules:components:google:google-forms"))
217217
implementation(project(":server:libs:modules:components:google:google-mail"))
218+
implementation(project(":server:libs:modules:components:google:google-maps"))
218219
implementation(project(":server:libs:modules:components:google:google-meet"))
219220
implementation(project(":server:libs:modules:components:google:google-sheets"))
220221
implementation(project(":server:libs:modules:components:google:google-slides"))

server/ee/apps/worker-app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ dependencies {
135135
implementation(project(":server:libs:modules:components:google:google-drive"))
136136
implementation(project(":server:libs:modules:components:google:google-forms"))
137137
implementation(project(":server:libs:modules:components:google:google-mail"))
138+
implementation(project(":server:libs:modules:components:google:google-maps"))
138139
implementation(project(":server:libs:modules:components:google:google-meet"))
139140
implementation(project(":server:libs:modules:components:google:google-sheets"))
140141
implementation(project(":server:libs:modules:components:google:google-slides"))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version="1.0"
2+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2025 ByteChef
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.bytechef.component.google.maps;
18+
19+
import static com.bytechef.component.definition.ComponentDsl.component;
20+
import static com.bytechef.component.definition.ComponentDsl.tool;
21+
22+
import com.bytechef.component.ComponentHandler;
23+
import com.bytechef.component.definition.ComponentCategory;
24+
import com.bytechef.component.definition.ComponentDefinition;
25+
import com.bytechef.component.google.maps.action.GoogleMapsGetRouteAction;
26+
import com.bytechef.component.google.maps.action.GoogleMapsNearbySearchAction;
27+
import com.bytechef.component.google.maps.connection.GoogleMapsConnection;
28+
import com.google.auto.service.AutoService;
29+
30+
/**
31+
* @author Nikolina Spehar
32+
*/
33+
@AutoService(ComponentHandler.class)
34+
public class GoogleMapsComponentHandler implements ComponentHandler {
35+
36+
private static final ComponentDefinition COMPONENT_DEFINITION = component("googleMaps")
37+
.title("Google Maps")
38+
.description(
39+
"Google Maps is a widely used mapping service by Google, offering free and feature-rich navigation, " +
40+
"location discovery, and real-time traffic updates accessible through web browsers and mobile apps.")
41+
.icon("path:assets/google-maps.svg")
42+
.categories(ComponentCategory.HELPERS)
43+
.connection(GoogleMapsConnection.CONNECTION_DEFINITION)
44+
.clusterElements(
45+
tool(GoogleMapsGetRouteAction.ACTION_DEFINITION),
46+
tool(GoogleMapsNearbySearchAction.ACTION_DEFINITION))
47+
.actions(
48+
GoogleMapsGetRouteAction.ACTION_DEFINITION,
49+
GoogleMapsNearbySearchAction.ACTION_DEFINITION);
50+
51+
@Override
52+
public ComponentDefinition getDefinition() {
53+
return COMPONENT_DEFINITION;
54+
}
55+
}

0 commit comments

Comments
 (0)