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

  • Home
  • SEARCH
  • 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 9174599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:46:51+00:00 2026-06-17T16:46:51+00:00

I am trying to request an image from the Google Static Maps API with

  • 0

I am trying to request an image from the Google Static Maps API with the borders of the map specified by a pair of latitude and longitude coordinates. I’ve tried centering on the center of the two coordinates, but there doesn’t seem to be any parameter for doing this with the Static API. Does anyone know how to do this?

Note: this is for a desktop application, and I am not using the Javascript API.

  • 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-06-17T16:46:51+00:00Added an answer on June 17, 2026 at 4:46 pm

    The thing is that you cannot base the request on the map’s corners because 1. zoom levels are discrete values and 2. the amount of latitude that a pixel represents varies with latitude. So, to display 2 degrees you’ll need a given map height near the equator and a different height, (greater), near the poles. Are you willing to display maps of different heights in order to fit always 2 degrees?

    If so, you can use the MercatorProjection object from my other post, and use the following function to calculate the necessary map size:

    <script src="MercatorProjection.js"></script>
    
    function getMapSize(center,zoom){
        var proj = new MercatorProjection();
        var scale = Math.pow(2,zoom);
        var centerPx = proj.fromLatLngToPoint(center);
        var SW = new google.maps.LatLng(center.lat()-1,center.lng()-1);
        var southzWestPx = proj.fromLatLngToPoint(SW);
        var NE = new google.maps.LatLng(center.lat()+1,center.lng()+1);
        var northEastPx = proj.fromLatLngToPoint(NE);
    
    // Then you can calculate the necessary width and height of the map:
        var mapWidth = Math.round((northEastPx.x - southzWestPx.x) * scale);
        var mapHeight = Math.round((southzWestPx.y - northEastPx.y) * scale); 
    }
    

    With center = new google.maps.LatLng(49.141404, -121.960988) and zoom = 7 you get that you need a map of (W x H) 182 x 278 pixels in order to display 2 x 2 degrees.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send a single image from my iPhone app to my Google
I get this error when trying to get a feed from Google Analytics API.
I'm trying to create a RestKit request to load an image from a web
Hi, I'm trying to make a website with Google Maps API and get coords
i´ve made a tutorial from google maps api to load markers from database and
I am trying to request JSON data from a PHP script in my Android
I'm trying to use Request.JSON in mooTools to bring in an object from a
I've been trying to Base64 encode image data from the user (in this case
Hi I am downloading an image from the following code HttpRequestMessage request = new
Here's what I'm trying to accomplish: Load an image from a remote server Save

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.