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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:25:26+00:00 2026-05-23T13:25:26+00:00

I need to display an array of latitude/longitude locations as an array on Google

  • 0

I need to display an array of latitude/longitude locations as an array on Google Maps (using the v3 api). My code’s below – any ideas why it’s not working? (There are no errors in the console)

var locs = ["51.38254, -2.362804", "51.235249, -2.297804", "51.086126, -2.210767", "51.084519, -2.262813", "51.175994, -2.159207", "51.132978, -2.213939", "51.207289, -2.181474", "51.321724, -2.205518", "51.317219, -2.210649", "50.700816, -1.925721", "50.719979, -2.074488", "50.810063, -1.919034", "50.785094, -1.849725", "50.842648, -1.777575", "50.723047, -1.902297", "50.743044, -1.880132", "51.71355, 0.154967", "51.992676, 0.602668", "52.355964, -1.486877", "53.523356, -1.107254", "51.87591, -2.235986", "51.670729, -1.934476", "51.542953, -0.28102", "51.52132, 0.098986", "52.271354, 0.788806", "51.346031, -0.478255", "51.263343, -1.140235", "51.481736, -1.089953", "51.476566, -0.514911", "51.505462, -0.555614", "51.558631, -1.78224", "51.351101, -1.995069", "51.380722, -2.039105", "51.416719, -2.124294", "51.42063, -2.133049", "51.533076, -1.925663", "51.348518, -1.797868", "51.331682, -1.776469", "51.127299, -1.568594", "51.082304, -1.172732", "50.994651, -1.495699", "50.988355, -1.499401", "51.074562, -1.774168", "51.066228, -1.799655", "51.071929, -1.794634", "51.218585, -1.515494", "51.080011, -1.860008", "5151.070508, -1.810412", "51.056581, -1.795259", "51.043955, -1.789822", "51.20323, -1.906011", "51.229055, -1.951243", "51.061094, -1.998836", "51.039063, -1.999079", "51.067313, -2.070322", "51.099235, -1.787773", "51.250454, -1.764469", "51.006591, -1.650057", "50.999451, -2.080693", "50.993131, -2.246465", "51.006542, -2.197207", "51.01744, -2.186619", "51.042629, -2.272731", "51.007395, -2.332772", "55.605281, -2.899154", "53.395123, -2.537949", "53.684928, -1.511449"];
var marker, i;
for (i = 0; i < locs.length; i++) {  
  marker = new google.maps.Marker({
    position: new google.maps.LatLng(locs[i]),
    map: map
  });
}
  • 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-23T13:25:26+00:00Added an answer on May 23, 2026 at 1:25 pm

    google.maps.LatLng() method takes 2 parameters. You are only passing in one.

    Google LatLng API

    Create a multidimesional array:

    var locs = [ ["51.38254", "-2.362804"], ["51.235249", "-2.297804"], ["51.086126", "-2.210767"], etc.

    and this will allow you to do:

    position: new google.maps.LatLng(locs[i][0], locs[i][1]),

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

Sidebar

Related Questions

Using javascript/jQuery: I have an array with images and I need to display them
I have a string-array, that i need to display in a layout. The code
I need to display 2 different feeds rss with Wordpress. I'm using this code:
My application uses Google Charts and using HTTPS. I need to display the Google
I need to display 2d images in opengl using textures. The image dimensions are
I need to display something such as below. Type A Type A Item 1
I need to display multiple annonation views in MKMapKit..I use this code.. - (void)viewDidLoad
I have a big array which i need to display the latest 10 items
How to display only array value in JSON out in php I am using
I need to display form-level errors in my forms (errors that do not belong

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.