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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:35:13+00:00 2026-06-04T10:35:13+00:00

I have a google api3 map. On idle, I calculate the radius of the

  • 0

I have a google api3 map. On idle, I calculate the radius of the visible area of the map, perform an ajax request and retrieve all of the markers in the visible area from an xml document.

Then I parse the xml, clear the current map markers and replace them with the new markers.

This works, with two caveats. 1) All of the markers flash when reloading. and 2) This causes me to download and reload markers, even if the user did not move the map far enough for them to be off-screen. In other words, I am reloading a marker that is already on the screen.

What is the best way to pull only the markers in the visible area of the map, and aren’t already on the screen?

I am going for performance, because I have a large amount of markers.

Test Url: http://whosopennow.com/maintenance/test.php# (Pan to Washington, DC)

  • 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-04T10:35:15+00:00Added an answer on June 4, 2026 at 10:35 am

    Assuming the map bounds do not include the International Date Line, or map wraps (you might have to set minimum zoom to 4 or so), I would take the following steps using map.getBounds() (not tested):

    1. At all times store the existing visible bounds. I’ll call it lastViewable.
    2. When the visible bounds are detected to have changed, perform the Ajax call.
    3. For each marker in the XML, if it’s outside lastViewable, add it to the screen. These are the new markers.
    4. Now, let’s say the map was dragged. Markers now outside the viewable area need to be removed.
    5. Set lastViewable to the current bounds
    6. Remove all markers outside these lastViewable bounds.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map powered by Google Maps Javascript API3 in my jQuery Mobile
Currently I have JavaScript that displays markers on a Google map using the Google
I need to display a google map with several markers. The problem I have
I have a map with multiple markers of companies using google maps API v3.
I have a google map in a page (Using the Javascript API v3) the
I have implemented the Google map successfully. But one more thing has left to
I have this simple hello world version of a google map api javascript v3
I have a package that requires Google Map library. And I implemented it like
I have a Google Map created with V3 API, and I wish to apply
I have a full screen Google map with HTML/CSS toolbars overlaid on the map,

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.