Skip to content

add fromPlaceId function#46

Open
bicf wants to merge 4 commits into
shukerullah:masterfrom
bicf:pr-master
Open

add fromPlaceId function#46
bicf wants to merge 4 commits into
shukerullah:masterfrom
bicf:pr-master

Conversation

@bicf

@bicf bicf commented Sep 6, 2023

Copy link
Copy Markdown

To allow to get geocode infos using the place_id string

@shukerullah shukerullah self-requested a review September 8, 2023 11:30
@shukerullah

Copy link
Copy Markdown
Owner

Hi @bicf,

Thank you for your PR! I appreciate the updates to the source file. Could you also consider updating the library folder for consistency? Let me know if you need any guidance.

@bicf

bicf commented Sep 11, 2023

Copy link
Copy Markdown
Author

Hi @bicf,

Thank you for your PR! I appreciate the updates to the source file. Could you also consider updating the library folder for consistency? Let me know if you need any guidance.

Hi @shukerullah
yes, absolutely!
I've actually already tried to update the library folder, but I'm quite new to the node ecosystem, so a little guidance will be appreciated.

Please let me know the tool you've used to build the lib file.

@shukerullah

shukerullah commented Sep 19, 2023

Copy link
Copy Markdown
Owner

Thanks @bicf and @ivan-redooc for your start on this! I've further enhanced the changes and merged the PR. Could you test it with a fromPlaceId and confirm if it's good to go? If so, can I request closing the ticket?

Here's an example of how to use it:

import { setDefaults, fromPlaceId } from 'react-geocode';

setDefaults({
  key: 'YOUR_API_KEY', // Replace with your API key
  language: 'en', // Default language for responses
  region: 'es' // Default region for responses
});

fromPlaceId('ChIJd8BlQ2BZwokRAFUEcm_qrcA')
  .then(({ results }) => {
    const { lat, lng } = results[0].geometry.location;
    console.log(lat, lng);
  })
  .catch(console.error);

Appreciate your help! 😊

@bicf

bicf commented Sep 19, 2023

Copy link
Copy Markdown
Author

Thanks @bicf and @ivan-redooc for your start on this! I've further enhanced the changes and merged the PR. Could you test it with a fromPlaceId and confirm if it's good to go? If so, can I request closing the ticket?

Yes

The sample code is correct!

…into pr-master

# Conflicts:
#	README.md
#	src/index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants