1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Google Map Embed not working

Discussion in 'Google' started by Barb Davids, Mar 31, 2021.

  1. #1
    Hi. Have you heard of Google map embed not working without an API?
    I have a client who is getting an error when they embed the code. Saying he needs an API. But I was able to embed just fine on a test page.

    Or do you recommend a WP plugin to embed a map on a website?

    Cheers!
    Barb
     
    Barb Davids, Mar 31, 2021 IP
  2. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #2
    Your client can try an iframe. For example, a map of New York, NY:

    https://jsfiddle.net/b1vnw6Ld/

    
    
    <style>
    .maps{position:relative;margin-right:auto;margin-left:auto;padding-bottom:55%;border:1px solid #c6c6c6;overflow:hidden}
    .map iframe{position:absolute;top:0;left:0;width:100%!important;height:100%!important}
    </style>
    
    <div class="map">
    <iframe src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=New York NY&amp;sll=&amp;sspn=&amp;ie=UTF8&amp;hq=New York NY&amp;hnear=New York NY&amp;cid=&amp;ll=&amp;spn=&amp;z=16&amp;iwloc=&amp;output=embed" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
    </div>
    
    
    Code (markup):
     
    qwikad.com, Mar 31, 2021 IP
  3. Barb Davids

    Barb Davids Member

    Messages:
    54
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    33
    #3

    Is that from the embed code from Google? That's what he used.
     
    Barb Davids, Mar 31, 2021 IP
  4. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #4
    Yes, this code is from Google. I wonder if the code he used was broken.
     
    qwikad.com, Mar 31, 2021 IP
  5. uday_yadav2

    uday_yadav2 Well-Known Member

    Messages:
    143
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #5
    This guide will help you how to set up Google Maps without API Key. Google Maps has changed their policy: https://developers.google.com/maps/documentation/javascript/usage-and-billing.
    https://developers.google.com/maps/documentation/embed/get-started

    I hope this may help you to fix your issue.
     
    uday_yadav2, Apr 1, 2021 IP
  6. Barb Davids

    Barb Davids Member

    Messages:
    54
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    33
    #6
    Barb Davids, Apr 2, 2021 IP
  7. ockarmoving

    ockarmoving Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    There can be several causes for this. But one that has caught me a few times, is inconsistent protocol usage (http | https). For example, if your main page is using https, but your iframe is using http, it won't show up.

    But then, how do you know ahead of time, what protocol the user will using? You don't and it, actually, doesn't matter. Just begin your iframe URL without a protocol indicator, like so
     
    ockarmoving, Jul 4, 2021 IP