Skip to content

Commit c004d82

Browse files
committed
feat(geocoder): Pass placeId to the callback function for geocodeByAddress function
1 parent 424779d commit c004d82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const geocodeByAddress = (address, callback) => {
44

55
geocoder.geocode({ address }, (results, status) => {
66
if (status !== OK) {
7-
callback({ status }, null)
7+
callback({ status }, null, null)
88
return
99
}
1010

@@ -13,6 +13,8 @@ export const geocodeByAddress = (address, callback) => {
1313
lng: results[0].geometry.location.lng(),
1414
}
1515

16-
callback(null, latLng)
16+
const placeId = results[0].place_id;
17+
18+
callback(null, latLng, placeId)
1719
})
1820
}

0 commit comments

Comments
 (0)