Hi there,

Is there anyone that can help me with some code.Basically I am
currently outputting markers retrieved from my MSSQL database onto a
Google Map. Unfortunately I need to output thousands of these markers
and I came across the solution of marker clustering... The tutorial
can be found here (http://gmaps-utility-library.googlecode.com/svn/
trunk/markerclusterer/1.0/docs/examples.html).

Here are snippets of my code:

/* Here is the function to call the map */

function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(
        document.getElementById("map"));
        map.addControl(new GSmallMapControl());
                map.addControl(new GMapTypeControl());
                map.addMapType(G_SATELLITE_3D_MAP);
        map.setCenter(
        new GLatLng(34.89438, -114.15069), 8);

/* Here is the function to create the markers */

function createMarker(point, text, title) {
          var markers =
          new GMarker(point,{title:title});
          return markers;
        }


    function createMarker(point, text, title) {
          var markers =
          new GMarker(point,{title:title});
          return markers;
        }


/* Here is where I retrieve all the values */

        $latLongSize = sizeof($lat)-1;

for($i=0; $i<=$latLongSize; $i++){ ?>

        var markers<?php echo $i; ?> = createMarker(new GLatLng(<?php echo
$lat[$i];?>, <?php echo $long[$i]; ?>));
                map.addOverlay(markers<?php echo $i; ?>);
        <?php } ?>

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

I think the problem may lie with how the data is feed into the
markerCluster variable. At the moment my code is outputting points
from my MSSQL database but not clustering the points.

I am having a lot of difficulty trying to work my code with the
tutorial example. Can anyone give advice or provide sample code on how
to approach fixing the code? If anything is unclear, please let me
know!


Cheers,

Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to