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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:57:57+00:00 2026-06-10T03:57:57+00:00

As pointed out in the question Keeping the InfoWindow in view when zooming map

  • 0

As pointed out in the question Keeping the InfoWindow in view when zooming map in, there appears to be a change with the v3 API that effects the default behavior when InfoWindows are visible.

Google’s default behavior on their own map site (http://goo.gl/maps/8ymit) accounts for this by handling zooming differently. It appears that the “center” of the zoom is set to the marker position if the currently selected marker is visible within the viewport; otherwise it defaults to the center of the map (or the location of the mouse in cases of double-click or mouse wheel scrolling).

How can I duplicate the behavior of the Google Maps site? I know how to get the location of the currently selected marker and to tell if it is visible. However, I have not had any luck setting the “center” of the zoom activity separately from setting the center of the map.

  • 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-10T03:57:58+00:00Added an answer on June 10, 2026 at 3:57 am

    The solution involves a lot of math. Here’s the general outline:

    1. Calculate the physical distance (usually in meters) shown between two edges of the current map viewport at the current zoom level.
    2. Determine the pixel distance from the nearest edge for the marker.
    3. Determine the distance shown between two edges of the current map at the new zoom level.
    4. Using the pixel distance from step 2, calculate what the new map center should be to keep the marker in the same relative location.
    5. Set the map zoom level and center point.

    Resources

    • Converting between Pixel and LatLng Coordinates
    • Spherical Geometry Library
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In another question , it was pointed out that using semantic markup can be
In another question , a user pointed out that the new keyword was dangerous
The answers to a previous question pointed out that the keywords meta tag in
In answering another question someone pointed out that in C# you can access a
Recently someone pointed out that my personal site was not working on ipad, because
I'm reading about STL algorithms and the book pointed out that algorithms like find
Recently, a coworker pointed out to me that compiling everything into a single file
Edit: As Andrew Moore pointed out this question is a duplicate of Two separate
As pointed out in this question when using filestream with sql server 2008 the
This question occurred to me after a user named patrick pointed out an error

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.