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

The Archive Base Latest Questions

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

How do I create a google map with a circle whose center changes every

  • 0

How do I create a google map with a circle whose center changes every
second? I tried the below: (also at
http://test.barrycarter.info/sunstuff2.html)

<!DOCTYPE html> 
<html> 
<head> 
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
<style type="text/css"> 
  html { height: 100% } 
  body { height: 100%; margin: 0px; padding: 0px } 
  #map_canvas { height: 100% } 
</style> 
<script type="text/javascript" 
    src="http://maps.google.com/maps/api/js?sensor=false"> 
</script> 
<script type="text/javascript"> 

function updateJ () { 
 j = j+0.5; 
 x.center = new google.maps.LatLng(j,0); 
} 

function initialize() { 
  var myLatLng = new google.maps.LatLng(0,0); 
  var myOptions = {zoom:2,  
    center: myLatLng, 
    mapTypeId: google.maps.MapTypeId.TERRAIN 
  }; 

  var map = new google.maps.Map(document.getElementById("map_canvas"), 
      myOptions); 

j = 20.18 

x = new google.maps.Circle({ 
 center: new google.maps.LatLng(j,-18.5037550725315), 
 radius: 10018760, 
 map: map, 
 strokeWeight: 2, 
 fillOpacity: 0.2, 
 fillColor: "#ffffff" 
}); 

} 

</script> 
</head> 
<body onload="initialize(); updateJ(); setInterval('updateJ()', 1000)"> 
  <div id="map_canvas" style="width:100%; height:100%"></div> 
</body> 
</html> 

Firebug confirms that ‘j’ increases every second, but this line:

x.center = new google.maps.LatLng(j,0); 

does nothing. Is there a google.maps.PleaseRedrawThisObjectBecauseIHaveChangedStuff method?

  • 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:43:16+00:00Added an answer on May 25, 2026 at 6:43 pm

    The API functions generally don’t support manually setting properties. Try using the getter/setter functions like so:

    x.setCenter(new google.maps.LatLng(j, 0));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a circle using the Google Maps V3 API and also tried to
I want to create google map using a pre-defined set of bounds. So instead
I am trying to create a Google Map where the user can plot the
I'm trying to center a google map on a single marker pulled from a
I need to create a range-graded circle proportional map, i.e., a map that has
When I create a Google Map and Share it, to the left, there is
Hi have an array of cities and want to create a google map using
How do I create a progress bar on top of google map in flex/as3?
I am working with google map api ... http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samplecode/GeocodingSimple.mxml What i want to do
I am using Google Maps V3 API to create a google map where the

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.