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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:46:51+00:00 2026-06-01T03:46:51+00:00

I have a call back url, that i’m am pulling out the Lat and

  • 0

I have a call back url, that i’m am pulling out the Lat and Lng to display as markers on a Google Maps. I am putting them into an array but I think i have to split them up in order for Google Maps to understand them.

function jsonData(){
        $.ajax({
            url: https://api.foursquare.com/v2/users/self/checkins?oauth_token=FUKXDJRWIB0AQ2MQUKUEUSB3KW2TMYKUMFGYLYUHBBH14CQ0&v=20120126,
            cache: false,
            dataType: 'json',
            success: function(results) {
                var lat;
                var long;
                var paths = [];
                for(var i = 0; i < results.response.checkins.items.length; i++) {
                    var lat = results.response.checkins.items[i].venue.location.lat;
                    var long = results.response.checkins.items[i].venue.location.lng;   
                    var pathDetails = lat +"," + long;
                    paths.push(pathDetails);
                }
                drop(paths);
            } 
        });
   };


        var directionsDisplay;
        var directionsService = new google.maps.DirectionsService();
        var map;

        var neighborhoods = [];

        var markers = [];
        var iterator = 0;

        function initialize() {
              var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
              directionsDisplay = new google.maps.DirectionsRenderer();
              //var newyork = new google.maps.LatLng(40.7051157, -74.0088305);
              var myOptions = {
                zoom:1,
                mapTypeId: google.maps.MapTypeId.ROADMAP
              }

              map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
              directionsDisplay.setMap(map);

              var start = "new york, ny";
              var end = "los angeles, ca";
              var request = {
                origin:start,
                destination:end,
                travelMode: google.maps.TravelMode.DRIVING
              };
              directionsService.route(request, function(result, status) {
                if (status == google.maps.DirectionsStatus.OK) {
                  directionsDisplay.setDirections(result);
                }
              });
          }


          function drop(neighborhoods) {
            console.log("Passing in data: " + neighborhoods);
            for (var i = 0; i < neighborhoods.length; i++) {
              setTimeout(function() {
                addMarker();
              }, i * 200);
            }
          }

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

$(document).ready(function() {
    jsonData();
    drop();

});
  • 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-01T03:46:53+00:00Added an answer on June 1, 2026 at 3:46 am

    I’ve made about 4 changes, what’s important is neighborhoods is both a local variable to drop (I renamed it to nx) and the global.

    See the changes here:
    http://jsfiddle.net/JVQTK/

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

Sidebar

Related Questions

I have a WCF service implemented with a call back contract that I am
I have the following code in html, I cannot get the Function call back
I have a button that uses jQuery and ajax to call a server side
I have an app that executes and displays reports from SSRS retrieved through URL
I have a jquery Ajax call function that I use to submit form to
How do I call a url in order to process the results? I have
I have a ajax call to a controller that is supposed to send me
I have a ajax call to a php script that updates my MySQL DB
So I have a google line chart visualization with a data set that has
I have a REST web service that I would like to take a URL

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.