Results 1 to 2 of 2

Thread: Loop in an Array??

  1. #1
    Join Date
    Mar 2010

    Loop in an Array??

    I would like to put all my coordinates into an array and have a loop display each one but with a Google function.

    Here's the code, which draws the points on google map:

     var flightPlanCoordinates = [
        new google.maps.LatLng(37.772323, -122.214897),
        new google.maps.LatLng(21.291982, -157.821856),
        new google.maps.LatLng(-18.142599, 178.431),
        new google.maps.LatLng(-27.46758, 153.027892)
    I would like to be able to do something like this:

    var arrPos = new Array([37.772323, -122.214897], [21.291982, -157.821856], [-18.142599, 178.431], etc. );
    var flightPlanCoordinates = [ + 
       for (i=0; i<arrPos.length; i++){
          new google.maps.LatLng(arrPos[0]) + ", "
       + "];"

    I know you can put a loop in an array but is there an alternate method to retrieving the points from the array??


  2. #2
    Join Date
    Sep 2012
    Sorry can't help you,i am a newbie and still have a lot of things to do to be right where you are.I hope you'll find a solution to deal with it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center