Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 258807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:12:40+00:00 2026-05-11T22:12:40+00:00

Right now I can use this URL to request a Google Static Maps image

  • 0

Right now I can use this URL to request a Google Static Maps image successfully:

http://maps.google.com/staticmap?center=37.687,-122.407&zoom=8&size=450x300&maptype=terrain&key=[my key here]&sensor=false

However, the second I use JQuery or any direct javascript to set an image’s src to the above url, Google passes back a Error 400:

“Your client has issued a malformed or illegal request.”

I’ve read that this is usually from the key being incorrect, but my key is clearly being passed.

This is how I’m setting the image dynamically:

document.getElementById('my-image-id').src = "http://maps.google.com/staticmap?center=37.687,-122.407&zoom=8&size=450x300&maptype=terrain&key=[my key here]&sensor=false"

I’ve replaced [my key here] with my correct key, and it still doesn’t work. When I request the same url through the browser, it’s fine. I’ve confirmed that the correct referrers are getting passed as well.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:12:41+00:00Added an answer on May 11, 2026 at 10:12 pm

    Does this code work for you (it works for me — be sure to insert your key)?

    <html>
    <head>
    <script language="javascript">
        function swap() {
            document.getElementById('my-image-id').src = "http://maps.google.com/staticmap?center=37.687,-122.407&zoom=8&size=450x300&maptype=terrain&key=&sensor=false"
        }
    </script>
    </head>
    <body>
    <img src="http://www.google.com/intl/en_ALL/images/logo.gif" width="450" height="300" onClick="swap();" id="my-image-id" />
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
NSURL *URL = [NSURL URLWithString:@http://www.stackoverflow.com]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; NSURLConnection *connection = [NSURLConnection
right_now = datetime.datetime.now() one_hour_before = ????? How can I use right_now to get one_hour_before?
How do you install Boost on MacOS? Right now I can't find bjam for
I'm pretty much at wits end right about now and can't seem to figure
I can't seem to see the forest for the trees right now (Looked at
I'm learning Ruby right now and I got stuck, maybe you guys can help
How can I validate the user input by using scanf. Right now I have
How can i make sure that several divs are slided up? Right now I
Users on my site can post news items. But right now, it's all honor

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.