-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to access the Geocoder? #32
Comments
|
Let me know if this answers your question and I'll close it |
Closed as duplicate of this |
Just for clarification, is there not a way to do a reverse geocode lookup entirely with this package? Is that considered out of scope? |
@rojobuffalo In my opinion this is out of scope. Geocoding and drawing maps are two different things, not only in this react wrapper but also in the Google Maps Api. With the native api you can't draw a map for a given address directly. And this is for a good reason: not every address (query string) results in one Lat/Lon response. And it is up to your application how you deal with multiple results. |
@rojobuffalo I don't think geocode lookup is scoped for this package really. We try to keep this package simple as well, and if you want to do something different you can always do it out of the box with the google maps api. |
In case somebody needs it:
|
@Bernabe-Felix Exactly what I was mentioning, thanks for sharing that! We can use anything from maps api using |
@Bernabe-Felix I wasn't able to get this to work in my code, it keeps saying that "InitGeocoder" is not defined. |
did you try |
@terrabl Depending on your structure you might need to do:
|
FYI when I do something like:
I get an error from Google saying that it's dangerous to use internal APIs. |
@kaycebasques Because you need to add
|
Except I don't want to use API internals ;) Google is explicitly warning against it. I think I got a solution working pretty easily with the Google Maps Node.js client.
My code is probably terribly unidiomatic... I'm a React newbie... but you get the idea. |
Hi! const stores: [
{
address: "Florida 533, caba, argentina",
id: 1,
},
{
address: "Maipu 233, caba, argentina",
id: 2,
}] <GoogleMapReact
onGoogleApiLoaded={initGeocoder}
yesIWantToUseGoogleMapApiInternals
>
/*
* I want to render 2 or more *stores*
*/
{
stores.map(sucursal =>
<MarkerComponent
address={sucursal.address} // this is the data that I have
/>
);
}
</GoogleMapReact> I can render 2 or more stores if I use |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I need to center on an address, not a lat/long.
The text was updated successfully, but these errors were encountered: