Embedding the new google map in your website

18,115

Solution 1

You have the latitude and longitude reversed:

Try this,

https://maps.google.com/?ie=UTF8&t=m&ll=13.2164639,74.995161&spn=0.003381,0.017231&z=16&output=embed

code snippet:

<iframe class="map" width="924" height="208" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/?ie=UTF8&t=m&ll=13.2164639,74.995161&spn=0.003381,0.017231&z=16&output=embed"></iframe>

Solution 2

On the new Google maps they added a "Share and embed map" option.

It's hidden in the little gear icon down on the right side of the map.

Or you can manually build it...but this is easier and it will also link to a company's Google listing.

Share:
18,115
Nagendra Rao
Author by

Nagendra Rao

~10 years of experience building top quality applications (Web apps, Backend Systems &amp; Mobile apps) from scratch. Expert in iOS Swift &amp; Node.JS Most recent work: Koo -&gt; https://apps.apple.com/us/app/id1515425674 ONE Championship -&gt; https://apps.apple.com/us/app/id1351178131 Scroll News, ScoopWhoop, WickedRide etc in the past

Updated on July 03, 2022

Comments

  • Nagendra Rao
    Nagendra Rao almost 2 years

    I just found out that the new google map doesn't have a link button that used to let people get the embed code which they can embed in their websites.

    LINK-1 LINK-2 (both links say 'click on "link" option to get the embed code')

    Also, They seem to have changed the url format,(a lot cleaner now!) Now it looks like:

    https://www.google.com/maps/preview?ie=UTF8#!data=!1m4!1m3!1d2020!2d74.995161!3d13.2164639
    

    where the !data parameter holds all the information(lat,long,zoom,screen span etc.,)

    !data=!1m4!1m3!1d2020!2d74.995161!3d13.2164639
    

    So I tried constructing the map's embed parameters manually(assuming that !2d74.995161 and !3d13.2164639 represent lat and long)

    <iframe class="map" width="924" height="208" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;t=m&amp;ll=74.995161,13.2164639&amp;spn=0.003381,0.017231&amp;z=16&amp;output=embed"></iframe>
    

    But to my surprise the above embed code is pointing to an entirely different location(Greenland Sea! where as my original link is of IND).

    My QUESTION: How to get the embed code in google's new map.

  • Nagendra Rao
    Nagendra Rao about 10 years
    Yes, now they have the share option, but at that time it wasn't present which made me post this question.