Daniel Bonnell
Daniel Bonnell

Reputation: 4997

Google Maps Embed API Address Not Found

I have embedded maps on each profile on my site. They all seem to work fine except for the one below. I'm not sure why, but when the map API loads, it's zoomed out so far you can see the whole world. Here is my iframe code with the query string:

<iframe width="250" height="250" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyAdGoEM5aW51rD_cyVwSBVrtAPZsEZruuQ&amp;q=177%20Huntington%20Ave.,Boston%20MA"></iframe>

Here is my API query string:

https://www.google.com/maps/embed/v1/place?key=AIzaSyAdGoEM5aW51rD_cyVwSBVrtAPZsEZruuQ&amp;q=177%20Huntington%20Ave.,Boston%20MA

Now if I copy everything after q=? into the regular Google Maps site (see new query string below) it pulls up the correct location as expected. There aren't any errors in the console.

https://www.google.com/maps/place/177%20Huntington%20Ave.,Boston%20MA

I've tried adjusting the address by using the following street name and building number combinations below:

I've also tried adjusting the city/state using the combinations below:

Not sure what else I could try to resolve this.

Upvotes: 2

Views: 2152

Answers (1)

kaho
kaho

Reputation: 4784

I think this is a bug. I created a bug in gmaps-api-issues.

meanwhile, as a workaround, you can:

1) use center and zoom level to make sure that even if the Embed API fail, your user still see a map in that area.

<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=177+Huntington+Avenue,+Boston,+MA,+United+States&center=42.3448913,-71.0829315&zoom=18&key=AIzaSyAdGoEM5aW51rD_cyVwSBVrtAPZsEZruuQ" allowfullscr

2) you can use the following code which is generated by the maps.google.com's Share or embed map function:

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2948.8889324642187!2d-71.0829315!3d42.3448913!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89e37a1052d49695%3A0xbdfe31a3b545364a!2s177+Huntington+Ave%2C+Boston%2C+MA+02115!5e0!3m2!1sen!2sus!4v1437088598386" width="250" height="250" frameborder="0" style="border:0" allowfullscreen></iframe>

Upvotes: 2

Related Questions