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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:57:43+00:00 2026-06-12T18:57:43+00:00

I copied everything from the Google marker clusterer example here and just changed the

  • 0

I copied everything from the Google marker clusterer example here and just changed the data for the points I want to use and the markers won’t show up on my mapp.. any idea why (code below)?

Chrome is giving me one warning

“resource interpreted as Script but transferred with MIME …etc, etc… “…data.json”

However, I printed the data using the document.write(data[i].lat) and such and everything prints fine…

<!DOCTYPE>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>MarkerClusterer v3 Example</title>

    <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 type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="data.js"></script>
    <script type="text/javascript" src="data.json"></script>
    <script type="text/javascript">
      var script = '<script type="text/javascript" src="../src/markerclusterer';
      if (document.location.search.indexOf('compiled') !== -1) {
        script += '_compiled';
      }
      script += '.js"><' + '/script>';
      //document.write(script);
      //document.write(data1);
      //var obj = jQuery.getJSON("data.json");
       document.write(data[0].lat);
      //alert( obj.name === "lat" );
    </script>

        <script type="text/javascript">
      function initialize() {
        var center = new google.maps.LatLng(37.4419, -122.1419);

        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 < 2; i++) {
          //var dataPhoto = data.photos[i];
          var latLng = new google.maps.LatLng(data.lat,
              data.lon);
          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>
    <h3>A simple example of MarkerClusterer (5 markers)</h3>
    <p>
      <a href="?compiled">Compiled</a> |
      <a href="?">Standard</a> version of the script.
    </p>
    <div id="map-container"><div id="map"></div></div>
  </body>
</html>

Here’s the data.json file content…

var data = [{"lat":37.4419,"lon":37.4419}, {"lat":37.4419,"lon":50.36}, {"lat":37.4419,"lon":137.4419}];
  • 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-12T18:57:44+00:00Added an answer on June 12, 2026 at 6:57 pm

    You asked:

    I copied everything from the Google marker clusterer example here and
    just changed the data for the points

    (the title says "everything is an exact copy of the tutorial)

    (it isn’t)

    any idea why?

    Something you changed:

    data.lat and data.lon are undefined.

    You want to use data[i].lat and data[i].lon

    Working example

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

Sidebar

Related Questions

I copied the Google Maps AutoComplete JS example from the demo here: Places Map
Everything works fine. My code as below copied from Google's guide. My problem is,
I copied guava-11.0.2 from gdata-java-client/gdata/java/deps/ when using google spreadsheets as described here /Setting up
I am following the django tutorial here . I have copied everything exactly. After
I copied the example straight from their page: http://jsfiddle.net/D2RLR/631/ ... and I get the
Just created a new MVC 4 project and copied over some areas from an
I have WPF DataGrid (VS2010 C#). I copied the data from DataGrid to Clipboard
I copied this example from api.jquery.com $('.target').change(function() { alert('Handler for .change() called.'); }); I
I'm using GoblinXNA to create an AR application. I copied EVERYTHING over from Tutorial
Problem : I build a project with Flash Builder. I copied everything from the

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.