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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:52:30+00:00 2026-05-27T23:52:30+00:00

When user pans the map, I make and ajax request to the server and

  • 0

When user pans the map, I make and ajax request to the server and get all the markers that fall into the new bounds, something almost identical to what is described here: Dynamically load Google Maps Markers with gmaps4rails

My problem is that when I use replaceMarker all the markers on the map are recreated therefore each of them flickers onces. This really annoys me.

If I use addMarkers, I don’t get the flicker effect, but my sidebar gets screwed because;
1) The markers which are left out of the bounds after pan, are not removed from my marker list.
2) Some duplicates are added to my marker list – markers that fall into intersection of old and new bounds.

I tried modifying the addmarkers function but nothing good came out of it.

  • 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-27T23:52:31+00:00Added an answer on May 27, 2026 at 11:52 pm

    This is how I changed the addMarkers function. Comparing the new_markers set to the old one to find out which ones to remove and leave the already existing ones alone.

    addMarkers : (new_markers) ->
      #update the list of markers to take into account
      @resetSidebarContent()
      added_markers = (marker for marker in new_markers when ($.grep(@markers, (a) -> a.id == marker.id).length == 0))
      removed_markers = (marker for marker in @markers when ($.grep(new_markers, (a) -> a.id == marker.id).length == 0))
      for marker in removed_markers
        @clearMarker(marker)
        @markers.remove(marker)
      @markers = @markers.concat(added_markers)
        #put markers on the map
      @create_markers()
      @adjustMapToBounds()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the user pans around a Google Map, a list of of currently visible
User equals untrustworthy. Never trust untrustworthy user's input. I get that. However, I am
User A logs into a ticket management system to edit content on SomePage.aspx User
Instead of loading all annotations that are in my array, I would only like
User may input character like Ā Ē ú, how to remove that mark and
User inputs a comma separated string and i d like to make a an
I need to display a set of markers on a google map. In addition,
User inserts new records in the table in his browser with no postback (using
User selects a date from the date-picker and the date is put into a
__USER_CS,__KERNEL_CS,__USER_DS,__KERNEL_DS, all have base=0x00000000 and limit=0xfffff. What I can't understand is that these linear

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.