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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:49:19+00:00 2026-06-15T00:49:19+00:00

I am using google geochart to put markers on a map. I want to

  • 0

I am using google geochart to put markers on a map. I want to be able to dynamically add and remove markers on the map with out having to redraw the map each time. Is there a way to accomplish that?

Thanks
Here is my code:

<div align="center">
  <div id="chart_div">
    <div id="loadingDiv"></div>
  </div>
</div>

<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type="text/javascript">
  //Load the Google Maps stuff
  google.load('visualization', '1', {'packages': ['geochart']});
  google.setOnLoadCallback(drawRegionsMap);

  //Load the Google Maps stuff
  google.load('visualization', '1', {'packages': ['geochart']});
  google.setOnLoadCallback(drawRegionsMap);


  function drawRegionsMap() {
    var data = new google.visualization.DataTable();
    data.addColumn('number', 'latitude');
    data.addColumn('number', 'longitude');
    data.addColumn('string', 'Location');
    data.addColumn('number', 'Size');

    //While iterating thru clients flag if user is in list, If not flagged add user to map.
    //Firefox doesn't seem to be including user in list
    var inList = false;
    for (i in clientInfo){ client = clientInfo[i];

      //Because new clients are creating with this connection, we don't want to add them to map.
      //Their clientInfo won't have an ipAddress. Only want to map one client per session
      if (client.ipAddress){
        //Flag if user is in client list
        if(client.ipAddress == userInfo.ipAddress){
          inList = true;
        }
        data.addRow([parseFloat(client.latitude), parseFloat(client.longitude), client.cityName, 4]);
      }
    }

    //If user is not in client list add him now.
    if(!inList){
      if(userInfo.ipAddress){
      data.addRow([parseFloat(userInfo.latitude), parseFloat(userInfo.longitude), userInfo.cityName, 4]);
      }
    }


    var options = {
      displayMode: 'markers',
      colorAxis: {colors: ['red', 'blue']},
      sizeAxis: {minValue: 0, maxValue: 5, minSize: 1, maxSize: 4},
      enableRegionInteractivity: true,
      legend: 'none'
    };

    var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
    google.visualization.events.addListener(chart, 'regionClick', function (eventData) {
      alert('You clicked: ' + eventData.region);
    });
    chart.draw(data, options);
  }
</script>
  • 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-15T00:49:20+00:00Added an answer on June 15, 2026 at 12:49 am

    You can create a dashboard and bind a control to it – for example the CategoryFilter. The chart will be updated automatically as the control’s filter is modified.

    However, this is limited and given your use case you will probably have to call the draw function yourself.

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

Sidebar

Related Questions

I'm using Google's GeoChart API to generate a map of the US. I want
I'm trying plot markers in a specific city using google Geochart when the region
I'm using the Google Visualization Geochart API to create a map of a country's
I'm using GeoChart from the Google Visualisation API to create a dynamic map containing
I'm using Google AppEngine with Java. I would like to be able to redirect
When using Google Chrome, I want to debug some JavaScript code. How can I
Im using Google Maps Javascript API V3, and recently the icons on my map
im using google maps api and im having this problem with showing the info
Using Google Checkout, I'm able to estimate tax based on the zip code that's
Using Google's Hello TabWidget tutorial found here I was able to build a tabWidget

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.