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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:09:28+00:00 2026-05-27T04:09:28+00:00

Using this data var data = { ‘address’: [ { ‘address’: ‘7970 GLENTIES Ln’

  • 0

Using this data

   var data = {
  'address': [
    {
      'address': '7970 GLENTIES Ln'
    },
    {
      'address': '8022 Caminito Mallorca'
    },
    {
      'address': '2750 Wheatstone St # 26'
    },
    {
      'address': '335 49th St'
    }  
  ]
};

i manage to marker them but i was unable to cluster them. below the code that I’ve use.

var markerArray = [];
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var center = new google.maps.LatLng(37.4419, -122.1419);

    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 3,
      center: center,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var address;
    var markers = [];
    for (var level in data) {
        for (var i = 0; i < data[level].length; i++) {
       //   var dataPhoto = data.photos[i];
          var dataAdd =  data[level][i];
        //  alert(dataAdd.address);
        geocoder.geocode({ 'address': dataAdd.address}, function(results){            
          var marker  = new google.maps.Marker({
              map: map, 
              position: results[0].geometry.location
          });
         markerArray[i] = marker;         
        });
        }
    }
    var markerCluster = new MarkerClusterer(map, markerArray);
  }

  google.maps.event.addDomListener(window, 'load', initialize);

How can i cluster them? it seem that the MarkerClusterer is not working or i dont know.

  • 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-27T04:09:29+00:00Added an answer on May 27, 2026 at 4:09 am

    Because the geocodeing function is async you need to create the marker clusterer before the markers have been created.

    what you should do is create the MarkerClusterer before you start geocoding and then instead of adding to a marker array you can instead just add it to the MarkerClusterer.

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

Sidebar

Related Questions

I have a dict object. I dumped the data using this: for alldata in
I've been using this nifty LINQ to SQL tool for a data access layer
I am accessing this data from a web server using NSURL, what I am
I have a data object that is deep-cloned using a binary serialization. This data
I have this big data-entry sort of page, a table kind of layout using
Need help writing a script downloads data from google insight using c# this is
I have an HBITMAP containing alpha channel data. I can successfully render this using
Has anyone encountered this error using SQL Server 2005 and Data access application blocks
I am using a form to Rate a page. This form posts data to
I have some data (E.g.: 'acs24','45','ds' etc). Using this data I have the following

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.