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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:28:15+00:00 2026-05-25T18:28:15+00:00

I’m trying to get Google Maps to continuously pan smoothly over unless the user

  • 0

I’m trying to get Google Maps to continuously pan smoothly over unless the user moves the mouse over the map. Using the ‘idle’ event handler causes a choppy pan animation. Using other events won’t give me results. Recursion of my initPan() function is just causing the page to crash. Example of the ‘idle’ continuous pan method here.

function initialize() {
    var myOptions = {
        zoom: 5,
        center: markers.sanjose,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById('map_canvas'),
            myOptions);

    google.maps.event.addListener(map, 'idle', function() {
        initPan(map);
    });

    google.maps.event.addListener(map, 'mouseout', function() {
        stopPan(map);
    });
}

function initPan(map) {
   map.panBy(5, 0);
}

function stopPan(){
}
  • 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-25T18:28:16+00:00Added an answer on May 25, 2026 at 6:28 pm

    Not a lot of views, no comments, but here’s my solution if anyone ever comes across this kind of situation.

    In triggering repeating methods by user events, such as panBy(), I ran into problems with API V3. While V2 had the ‘moveend’ event, it was replaced with the ‘idle’ event. However, ‘idle’ has a short delay after the pan occurs. Another option is to use the ‘bounds_changed’ event, but this event fires multiple times per second, causing the map to never load tiles (hence no panning appearance).

    I finally solved this issue by adding a timeout delay to the ‘bounds_changed’, clearing the timeouts that would stack on the multiple event triggers. This is the code snippet that solved the issue.

    google.maps.event.addListener(map, 'bounds_changed', function() {
      if (moving) {
        if (myTimeout) {
          window.clearTimeout(myTimeout);
        }
        myTimeout = window.setTimeout(initPan(map), 2200);
      }
    });
    

    I found the solution on the API forum, and you can see an example of my working continuous panning here. And if this isn’t making any sense, look at the full code on the example, and good luck.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but

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.