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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:08:40+00:00 2026-06-11T06:08:40+00:00

Hy i am unable to display multiple markers in Google Maps V3, i am

  • 0

Hy i am unable to display multiple markers in Google Maps V3, i am getting the coordinates correctly but not displays on map. Also no errors in console

  1. map_items[0] = title
  2. map_items[1] = 55.153766, 11.909180
  3. map_items[2] = link
  4. map_items[3] = text

all of them appear correctly if i do an alert.
example

“Title”,”51.00150763193481, -2.5659284999999272″, “link”, “text”

 function initialize() {
            var map = new google.maps.Map(document.getElementById('map'), {
                zoom: 7,
                center: new google.maps.LatLng(55.153766, 11.909180),
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });
            for (var x = 0; x < temp.length; x++) {
                if(temp[x][1]){
                    var map_items = temp[x];
                    var myLatlng = new google.maps.LatLng(map_items[1]);
                    var marker = new google.maps.Marker({
                        map: map,
                        position: myLatlng,
                        title: map_items[0]
                    });
                    google.maps.event.addListener(marker, 'click', function() {
                        infowindow.setContent('<div class="google_marker"><a href="'+map_items[2]+'">'+map_items[0]+'</a><br /><p>'+map_items[3]+'</p></div>');
                        infowindow.open(map, marker);
                    });
                }
            }
        }
  • 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-11T06:08:42+00:00Added an answer on June 11, 2026 at 6:08 am

    google.maps.LatLng() takes two parameters, not one, so:

    var latlon = map_items[1].split(',');
    var myLatlng = new google.maps.LatLng(parseFloat(latlon[0]), parseFloat(latlon[1]));
    

    though in fact, it would be better to use objects rather than an array in which each item contains different data types, for example:

    marker_data[0] = {
      "lat": 55.153766,
      "lon": 11.909180,
      "title": "My Title",
      "link": "http://stackoverflow.com"
    }
    //etc...
    

    and then you’d access it like this:

    var myLatlng = new google.maps.LatLng(marker_data[0].lat, marker_data[0].lon);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display multiple chart's on one screen but i am not
I am writing a website code but I am unable to display the border
I am calling a rest webscript using Extjs with JSON,but unable to display on
I'm returing session data from my database, but I'm unable to display the LastName
I've rechecked my code many times but i am unable to display the access
I followed this but I am still unable to display CHOICES as checkboxes on
why i am unable to display the text in my dev box? <script type=text/javascript>
I'm getting an Unable to obtain public key for StrongNameKeyPair. exception using Newtonsoft's JsonConvert.SerializeObject
I am getting a Unable to load the requested file: default.php error in codeigniter
I am unable to display both the setContentView(R.layout.main) and View together. I think I

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.