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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:12:34+00:00 2026-06-04T21:12:34+00:00

Ok so I developed the following code to use Google Maps with Marker Clusterer.

  • 0

Ok so I developed the following code to use Google Maps with Marker Clusterer.
I used the example on the website and slightly modified it for my json data.
My issue here is, I am not getting any errors but its not working either.
What am I doing wrong here?

Thanks

<head>
    <style type="text/css">
        body {
            margin: 0;
            padding: 10px 20px 20px;
            font-family: Arial;
            font-size: 16px;
        }

        #map-container {
            padding: 6px;
            border-width: 1px;
            border-style: solid;
            border-color: #ccc #ccc #999 #ccc;
            -webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
            -moz-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
            box-shadow: rgba(64, 64, 64, 0.1) 0 2px 5px;
            width: 600px;
        }

        #map {
            width: 600px;
            height: 400px;
        }
    </style>

    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script src="http://google-maps-utility-library-v3.googlecode.com/" +
        "svn/trunk/markerclusterer/src/markerclusterer.js">
    </script>

    <script type="text/javascript">
        var data = {
            "users": [ 
                { "latitude":"48.4048403957642",
                    "longitude":"2.68452644348145" },
                { "latitude":"48.4050236871384",
                    "longitude":"2.68512690051361"},
                { "latitude":"48.4048403957642",
                    "longitude":"2.68452644348145"},
                { "latitude":"48.7570941168018",
                    "longitude":"2.16670989990234"},
                { "latitude":"48.404922961092",
                    "longitude":"2.70020564018949"},
                { "latitude":"48.8739279353421",
                    "longitude":"2.32875823974609"},
                { "latitude":"48.4048403957642",
                    "longitude":"2.68452644348145"},
                { "latitude":"41.0349860434783",
                    "longitude":"28.9774059609177"}
            ]
        };

        function initialize() {
            var center =
                new google.maps.LatLng(48.404840395764175,
                    2.6845264434814453);

            var map = new google.maps.Map(document.getElementById('map'), {
                zoom: 3,
                center: center,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            });

            var markers = [];
            for (var i = 0; i < data.length; i++) {
                var location = data.users[i];
                var latLng =
                    new google.maps.LatLng(location.latitude,
                        location.longitude);
                var marker = new google.maps.Marker({ position: latLng });
                markers.push(marker);
            }

            var markerCluster = new MarkerClusterer(map, markers);
        }

        google.maps.event.addDomListener(window, 'load', initialize);
    </script>  
</head>
<body>
    <div id="map-container"><div id="map"></div></div>
  • 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-04T21:12:35+00:00Added an answer on June 4, 2026 at 9:12 pm

    The markers aren’t being added because

    for (var i = 0; i < data.length; i++) {

    should be

    for (var i = 0; i < data.users.length; i++) {

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

Sidebar

Related Questions

I developed a website for 1024x768 and used the following viewport: <meta name=viewport content=width=768,
My goal is to understand every single bit of the following example: http://code.google.com/p/google-api-java-client/wiki/AndroidAccountManager I
I use VS2010, C# to develop Silverlight 4 app, I use following code in
i have a stupid question...sometimes i see developers use the following code... NSString *newURL
I'm following this guide: http://code.google.com/intl/it-IT/apis/documents/docs/2.0/developers_guide_java.html I just need to retrieve a token and use
I am using the following code to login to asp website but it doesnt
I'm trying to use the following code so when a person clicks on a
I must have used someone's existing code as a framework, and I developed a
I´m trying to understand and use the Picasa Api, I´m using this example https://developers.google.com/picasa-web/docs/2.0/developers_guide_java?hl=nl-NL
The following code snippet is from The Official GNOME 2 Developer's Guide : GMemChunk

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.