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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:34:42+00:00 2026-05-27T17:34:42+00:00

I’m working on displaying several batches of markers using the Google Maps api (v3)

  • 0

I’m working on displaying several batches of markers using the Google Maps api (v3) and jQuery.

I’ve got it working almost exactly as I want it but I would need to drop the markers one by one instead of all at once.

I’ve found this example on the Google maps documentation but I can’t work out how to integrate it with my script.

Would someone please be able help me?

Here’s my code so far:

$(document).ready(function () {
    $("#map").css({
        height: 600,
        width: 958
    });
    var jeLatLng = new google.maps.LatLng(17.74033553, 83.25067267);
    jeMap.init('#map', jeLatLng, 11);

    $("#showmarkers").click(function (e) {
        jeMap.placeMarkers('markers.xml');
    });
    $("#showmarkers2").click(function (e) {
        jeMap.placeMarkers('markers2.xml');
    });
});

var jeMap = {
    map: null
}

var UK = new google.maps.LatLng(21.192481, 0.0);

jeMap.init = function (selector, latLng, zoom) {
    var myOptions = {
        zoom: 2,
        center: UK,
        mapTypeId: google.maps.MapTypeId.HYBRID,
        streetViewControl: false,
        mapTypeControl: false,
        backgroundColor: '#111'
    }
    this.map = new google.maps.Map($(selector)[0], myOptions);
}

var infoWindow = new google.maps.InfoWindow();

jeMap.placeMarkers = function (filename) {
    $.get(filename, function (xml) {
        $(xml).find("marker").each(function () {
            var name = $(this).find('name').text();
            var address = $(this).find('address').text();

            // create a new LatLng point for the marker
            var lat = $(this).find('lat').text();
            var lng = $(this).find('lng').text();
            var point = new google.maps.LatLng(parseFloat(lat), parseFloat(lng));

            var marker = new google.maps.Marker({
                map: jeMap.map,
                position: point,
                animation: google.maps.Animation.DROP,
                icon: 'marker_pink.png'
            });

            var html = '<strong>' + name + '</strong.><br />' + address;
            google.maps.event.addListener(marker, 'click', function () {
                infoWindow.setContent(html);
                infoWindow.open(jeMap.map, marker);
            });
        });
    });
}

I understand I need to somehow modify the jeMap.placeMarkers function so it loops through each marker with a delay between each cycle, just can’t figure out how.

  • 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-27T17:34:43+00:00Added an answer on May 27, 2026 at 5:34 pm

    How about this:

    jeMap.placeMarkers = function (filename) {
        //setup counter variable
        var counter = 0;
        $.get(filename, function (xml) {
            $(xml).find("marker").each(function () {
                var name = $(this).find('name').text();
                var address = $(this).find('address').text();
    
                // create a new LatLng point for the marker
                var lat = $(this).find('lat').text();
                var lng = $(this).find('lng').text();
                var point = new google.maps.LatLng(parseFloat(lat), parseFloat(lng));
    
                //set timeout based on maps example
                setTimeout(function() {
                    addMarker(point, address, name);
                }, counter * 200);
    
                //increment counter
                counter++;            
            });
        });
    }
    
    //add marker with specific point.
    function addMarker(point, address, name){
        var marker = new google.maps.Marker({
            map: jeMap.map,
            position: point,
            animation: google.maps.Animation.DROP,
            icon: 'marker_pink.png'
        });
    
        var html = '<strong>' + name + '</strong.><br />' + address;
        google.maps.event.addListener(marker, 'click', function () {
            infoWindow.setContent(html);
            infoWindow.open(jeMap.map, marker);
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into

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.