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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:56:53+00:00 2026-06-06T21:56:53+00:00

Using Casey P Thomas’ solution to handling multiple markers in a single location: Example:

  • 0

Using Casey P Thomas’ solution to handling multiple markers in a single location:

Example: http://maps.caseypthomas.org/ex/MarkerClustererPlus/exCoincidentMarkers_SharedInfowindow_wGeocoding.html

It works great and combines the content into a single info window, however there does seem to be a geocoding limit on the api which is breaking the map. I dont even need to geocode the addresses, as I have a list of co-ords that I am passing in.

So my question is, how could I bypass the geocoding function from the JS and build the map that way?

Thanks

Code I am using:

        var map;

    //marker clusterer
    var mc;
    var mcOptions = {gridSize: 20, maxZoom: 17};

    //global infowindow
    var infowindow = new google.maps.InfoWindow();

    //geocoder
    var geocoder = new google.maps.Geocoder(); 

    //Content and Geos
    var address = new Array(<?php echo $tweetgeos;?>);
    var content = new Array(<?php echo $tweets;?>);


    function createMarker(latlng,text) {
        var marker = new google.maps.Marker({
            position: latlng
        });

        ///get array of markers currently in cluster
        var allMarkers = mc.getMarkers();


        //check to see if any of the existing markers match the latlng of the new marker
        if (allMarkers.length != 0) {
            for (i=0; i < allMarkers.length; i++) {
                var existingMarker = allMarkers[i];
                var pos = existingMarker.getPosition();

                if (latlng.equals(pos)) {
                    text = text + " & " + content[i];
                }
            }
        }

        google.maps.event.addListener(marker, 'click', function() {
            infowindow.close();
            infowindow.setContent(text);
            infowindow.open(map,marker);
        });

        return marker;
    }


    function geocodeAddress(address,i) {
        geocoder.geocode( {'address': address}, function(results, status) {

            if (status == google.maps.GeocoderStatus.OK) {

                var marker = createMarker(results[0].geometry.location,content[i]);
                mc.addMarker(marker);

            } else { 
                alert("Geocode was not successful for the following reason: " + status); 
        } 

        });
    }

    function initialize(){
        var options = { 
            zoom: 5, 
            center: new google.maps.LatLng(51.50733,-0.12768), 
            mapTypeId: google.maps.MapTypeId.ROADMAP 
        }; 

        map = new google.maps.Map(document.getElementById('map'), options); 


        //marker cluster
        mc = new MarkerClusterer(map, [], mcOptions);
        for (i=0; i<address.length; i++) { 
            geocodeAddress(address[i],i);
        }
    }

    google.maps.event.addDomListener(window, 'load', initialize);
  • 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-06T21:56:55+00:00Added an answer on June 6, 2026 at 9:56 pm

    You can initialize your markers directly with your coordinates and without calling Geocoding API.

    // Change address Array to an Array of JS Objects
    var address = [
        {
            latitude: lat1,
            longitude: lng1,
        },
        {
            latitude: lat2,
            longitude: lng2,
        },
        ...
    ];
    
    // In function:createMarker()
    var myLatLng = new google.maps.LatLng(latlng.latitude, latlng.longitude);
    var marker = new google.maps.Marker({
        position: myLatLng,
    });
    
    // In function:initialize()
    for (i=0; i<address.length; i++) { 
        createMarker(address[i], content[i]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's
in the case of using PreparedStatement with a single common connection without any pool,
Using some random CSV data from data.gov, for example: Gravesite locations of Veterans and
Struggling to parse this JSON response from http://api.twitter.com/1/trends/current.json using foreach ($json_output->trends[0] as $trend )
I'm updating multiple columns using case when. I want no action taken on cases
What are the best practices for using use cases to model system behavior that
I am trying to realize a use-case using git. Use Case : It should
Preface: I'm know that in most cases using a volatile field won't yield any
I am trying to match for country or Country using lower-case function in XPath.
Besides readability is there any significant benifit to using a CASE WHEN statement vs

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.