Am having trouble with Marker Clusterer please help =)

36 views
Skip to first unread message

Matt Chan

unread,
Jul 21, 2011, 5:02:22 PM7/21/11
to google-map...@googlegroups.com
http://jsfiddle.net/3pXXF/21/
^ link to my script
var Markers [];

var dots [
    [0-1"A"],
    [0-2"B"],
    [0-3"C"],

    ];

function initialize({
    var latlng new google.maps.LatLng(00);

    var myOptions {
        zoom6,
        centerlatlng,
        mapTypeIdgoogle.maps.MapTypeId.ROADMAP
    };

    var map new google.maps.Map(document.getElementById("map_canvas"),myOptions);
    var image 'i/hotel-map-pin.png';

    var mc new MarkerClusterer(mapmarker);

    google.maps.event.addListener(map'click'function({
        infowindow.close();
    });

    for (var 0dots.lengthi++{
        var marker new google.maps.Marker({
            positionnew google.maps.LatLng(dots[i][0]dots[i][1]),
            mapmap,
            titledots[i][2]


        });
        mc.addMarkers(markerArraytrue);
    }

}
window.onload initialize;



geoco...@gmail.com

unread,
Jul 21, 2011, 5:34:22 PM7/21/11
to Google Maps JavaScript API v3
On Jul 21, 2:02 pm, Matt Chan <m...@eggcartel.com> wrote:
> http://jsfiddle.net/3pXXF/21/
> ^ link to my script

Would you care to share what the trouble is?

--Larry

Matt Chan

unread,
Jul 21, 2011, 5:47:21 PM7/21/11
to google-map...@googlegroups.com
Sorry, I should of mentioned that, basically my markers are showing on the map but they don't cluster. Am not sure if am using the MarkerClusterer in the wrong way in my script or something else is going on

when i read the example script provided in the documentation it mentioned 

var markers = [];

// stick your marker array in here

var mc = new MarkerClusterer(map, marker);

I have no idea how to make it work, I think am missing something

Luke Mahé

unread,
Jul 21, 2011, 7:15:21 PM7/21/11
to google-map...@googlegroups.com
markerArray is undefined and never has any markers in it.

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/0HHw7Pe0oFYJ.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Matt Chan

unread,
Jul 21, 2011, 7:51:00 PM7/21/11
to google-map...@googlegroups.com
I figure it out myself, thanks anyways luke !

Heres's a working MarkerCluster 

Reply all
Reply to author
Forward
0 new messages