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 1013105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:02:55+00:00 2026-05-16T10:02:55+00:00

I think the title is enough, I don’t even see how to do this

  • 0

I think the title is enough, I don’t even see how to do this for the V2 and V1 API :/

Thanks 🙂

  • 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-16T10:02:55+00:00Added an answer on May 16, 2026 at 10:02 am

    As the other answers suggested, the fitBounds() method should do the trick.

    Consider the following example, which will generate 10 random points on the North East USA, and applies the fitBounds() method:

    <!DOCTYPE html>
    <html> 
    <head> 
       <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
       <title>Google Maps LatLngBounds.extend() Demo</title> 
       <script src="http://maps.google.com/maps/api/js?sensor=false" 
               type="text/javascript"></script> 
    </head> 
    <body> 
       <div id="map" style="width: 400px; height: 300px;"></div> 
    
       <script type="text/javascript"> 
    
       var map = new google.maps.Map(document.getElementById('map'), { 
         mapTypeId: google.maps.MapTypeId.TERRAIN
       });
    
       var markerBounds = new google.maps.LatLngBounds();
    
       var randomPoint, i;
    
       for (i = 0; i < 10; i++) {
         // Generate 10 random points within North East USA
         randomPoint = new google.maps.LatLng( 39.00 + (Math.random() - 0.5) * 20, 
                                              -77.00 + (Math.random() - 0.5) * 20);
    
         // Draw a marker for each random point
         new google.maps.Marker({
           position: randomPoint, 
           map: map
         });
    
         // Extend markerBounds with each random point.
         markerBounds.extend(randomPoint);
       }
    
       // At the end markerBounds will be the smallest bounding box to contain
       // our 10 random points
    
       // Finally we can call the Map.fitBounds() method to set the map to fit
       // our markerBounds
       map.fitBounds(markerBounds);
    
       </script> 
    </body> 
    </html>
    

    Refreshing this example many times, no marker ever goes outside the viewport:

    fitBounds demo

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

Sidebar

Related Questions

I don't how to frame the title for this question. If not appropriate please
I would like some feedback I think the title speaks already for itself, but
I had some problems figuring out a good title, but hopefully the code examples
Disclaimer This question is a repost. I originally asked it here . While there
So I decided to rewrite my image gallery because of the new high performance
I have an unnormalized events-diary CSV from a client that I'm trying to load
I'm using pdftotext to convert Spanish language text. Characters with accents or tildes are
I have the following code to display JSON results from an AJAX request as
i want to do the following: open a web browser on my local network.

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.