Search code examples
google-mapsgoogle-maps-embed

Google Maps Embed displaying incorrect address on directions


I have just added a very simple code snippet to a client's website using the Google Maps Embed API. This displays all of the correct details, but when you click on the "Directions" link, a different address is displayed. You can see the problem on the web page here, http://www.picturesbyrob.co.uk/contact-us/

Anyone seen a problem like this before? I'm not sure if there's an underlying issue with the data or with the application.

Any pointers gratefully received. Thanks.


Solution

  • It is because the coordinates that are passed in your direction request are https://maps.google.com/maps?ll=54.033922,-0.589114&z=7&t=m&hl=en-US&gl=US&mapclient=embed&daddr=Photographer%20in%20York%20118%20Middlecroft%20Drive%20Strensall%20York%2C%20North%20Yorkshire%20YO32%205YQ%2C%20United%20Kingdom@54.033922,-1.045047

    Latitude : 54.033922 Longitude : -1.045047

    Which is the address you are getting on the Google Maps when you click on the direction link.

    THe coordinates for the address you are looking which is 118 Middlecroft Drive, Strensall, York, York YO32 5YQ, UK are

    Latitude : 54.0338228 Longitude : -1.0447040000000243

    Try putting this explicitly in your request instead of geocoding it!