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

  • Home
  • SEARCH
  • 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 8950225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:24:24+00:00 2026-06-15T13:24:24+00:00

I have successfully bound a circle to my marker using google map api v3.

  • 0

I have successfully bound a circle to my marker using google map api v3. I know this because if I make the marker dragable the circle moves as well.

How can I refer to the circle if the marker is clicked. I need to show the circle if not visible or vice-versa.

Here is the code to create the marker and circle

var markerOptions = {
title: title,
icon: markerImage,
shadow: markerShadow,
position: latlng,
map: map
}
var marker = new google.maps.Marker(markerOptions);   
// Add a Circle overlay to the map.
var circle = new google.maps.Circle({
map: map,
radius: 50*1609.34,// 50 MI
visible: false
});
//circle.bindTo('map', marker);
circle.bindTo('center', marker, 'position');

I found an answer on stackoverflow that led me to think I needed to do the rem’d out map binding as well the center binding, but that did not work.

Here is my click event for the marker.

google.maps.event.addListener(marker, "click", function() {
var infowindowOptions = {
content: html
 }
var infowindow = new google.maps.InfoWindow(infowindowOptions);
cm_setInfowindow(infowindow);
infowindow.open(map, marker);
marker.setIcon(markerImageOut);
marker.circle({visible: true});

Any ideas. I need to interact with the bound circle of the marker that was just clicked or moused over.

  • 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-15T13:24:25+00:00Added an answer on June 15, 2026 at 1:24 pm

    One option is to make the circle a property of the marker (like ._myCircle), reference it in the click handler as marker._myCircle.

    Add the circle as the _myCircle property of marker:

    var circle = new google.maps.Circle({
      map: map,
      radius: 50*1609.34,// 50 MI
      visible: false
    });
    circle.bindTo('center', marker, 'position');
    marker._myCircle = circle;
    

    To toggle it use something like (not tested):

    if(marker._myCircle.getMap() != null) marker._myCircle.setMap(null);
    else marker._myCircle.setMap(map);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using MVVM style I have successfully bound an ObservableCollection<string> to a ListBox , showing
I have successfully implemented a standard WCF service bound to MSMQ using the net.msmq
I have successfully bound a control to a property on my page. The property
I have successfully been using the eclipse Indigo internal browser to view my web
i have successfully created distribution profiles and installed on my xcode organiser, but this
I have successfully created and bound computed properties, but how can I get at
I'm trying to set up an NSCollectionView (I have done this successfully in the
I'm building a data entry interface and have successfully bound the columns that have
I'm creating a Silverlight App. I have successfully created the data, bound it to
I have successfully bound my DataGridView to a list. But, the grid doesn't refresh

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.