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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:14:37+00:00 2026-06-02T23:14:37+00:00

i´ve made a tutorial from google maps api to load markers from database and

  • 0

i´ve made a tutorial from google maps api to load markers from database and php with a generated xml file to the map. Now i am trying to add a delay with setTimeout or so to drop one marker after another like this example. I very beginner and would very happy if someone can tell me how to do this!

downloadUrl("php/addLocations.php", function (data) {
    var xml = parseXml(data);
    var markers = xml.documentElement.getElementsByTagName("marker");
    for (var i = 0; i < markers.length; i++) {
        var name = markers[i].getAttribute("name");
        var address = markers[i].getAttribute("address");
        var type = markers[i].getAttribute("type");
        var profile_image = markers[i].getAttribute("myimage");
        var point = new google.maps.LatLng(
        parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng")));
        var html = "<b>" + name + "</b> <br/>" + address + "<br/>" + "<img src='uploads/" + profile_image + "' width='100px' />";
        var icon = customIcons[type] || {};
        var marker2 = new google.maps.Marker({
            map: bigmap,
            position: point,
            icon: icon.icon,
            animation: google.maps.Animation.DROP,
            shadow: icon.shadow
        });
        bindInfoWindow(marker2, bigmap, infoWindowLoc, html);
    }
});


var infoWindowLoc = new google.maps.InfoWindow;

function bindInfoWindow(marker2, bigmap, infoWindowLoc, html) {
    google.maps.event.addListener(marker2, 'click', function () {
        //openMarkerBox(); 
        // panning map
        bigmap.panTo(marker2.position);
        infoWindowLoc.setContent(html);
        infoWindowLoc.open(bigmap, marker2);
    });
}

function downloadUrl(url, callback) {
    var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest;

    request.onreadystatechange = function () {
        if (request.readyState == 4) {
            request.onreadystatechange = doNothing;
            callback(request.responseText, request.status);
        }
    };

    request.open('GET', url, true);
    request.send(null);
}

function parseXml(str) {
    if (window.ActiveXObject) {
        var doc = new ActiveXObject('Microsoft.XMLDOM');
        doc.loadXML(str);
        return doc;
    } else if (window.DOMParser) {
        return (new DOMParser).parseFromString(str, 'text/xml');
    }
}

function doNothing() {
    alert("shit")
}
  • 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-02T23:14:39+00:00Added an answer on June 2, 2026 at 11:14 pm

    Well, if you inspect the code at your example, everything you need is there. Take a look at:

    1 – The onclick handler that is attached to the Drop Markers button:

    `<button id="drop" onclick="drop()">Drop Markers</button>`
    

    Online documentation for onclick is available: at this link.

    2 – The drop() function from your example:

    function drop() {
        for (var i = 0; i < neighborhoods.length; i++) {
            setTimeout(function() {
                addMarker();
            }, i * 200);
        }
    }
    

    Online documentation for the setTimeout function is available: at this link.

    3 – The addMarker() function from your example:

    function addMarker() {
        markers.push(new google.maps.Marker({
            position:  neighborhoods[iterator],
            map:       map,
            draggable: false,
            animation: google.maps.Animation.DROP
        }));
        iterator++;
    }
    

    Online documentation for google.maps.marker animation is available: at this link.

    Walk through the code, dig in a little, and you should be able to figure this out.

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

Sidebar

Related Questions

I pretty much copied the code from the tutorial: https://developers.google.com/maps/articles/phpsqlajax_v3 (Of course, I made
I was following this tutorial in order to integrate a pre made database to
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I made a simple pong game from a tutorial (icode blog)and would like to
I have made a C# COM object by following the tutorial. http://www.codeproject.com/Articles/18939/C-Com Now I
I am having trouble with the Hello Map Views tutorial from the Android Developer
I'm newbie in php mysql and google maps v3. I have a problems in
I made the basic blog demo from a rails tutorial in a book from
I have this menu I found how to made on a tutorial but I
I was reading over the tutorial here: http://www.1keydata.com/sql/sql-running-totals.html and it all made sense until

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.