What steps will reproduce the problem?
1. Use the following setup when defining my GMap2 object and
MarkerClusterer object:
gmap = new GMap2(document.getElementById("map"));
mcOptions = { gridSize: 70, maxZoom: 14, styles: [{height: 42, width:
51, url: '/images/gmaps/CAR_Multi_Marker.png'}]};
mc = new MarkerClusterer(gmap, [], mcOptions);
2. Create map with 200+ markers.
3. One of the MarkerClusters contains over 10 markers. In the
'calculator_' function, starting on line 100, this causes the 'index'
variable to be set to 2.
4. On lines 109-111 code produces a bug because I only have 1 style, not 2:
(bug is specifically on line 110)
108: var stylesCount = this.getStyles().length;
109: if (stylesCount < index) {
110: index = this.getStyles.length;
111: }
5. MarkerClusterer sees it cannot use a style with an index value of 2.
There is only one style. Line 110 attempts to set the index to the max
style index. However, an incorrect class object is referenced and the
wrong index value is set.
What is the expected output? What do you see instead?
On line 110, index should be set to the max style index value. For my
case, the value should be 1. However, the value is set to 0 because of an
incorrect class object reference. The code on line 110 should be changed to:
index = stylesCount; //index = this.getStyles().length
What version of the product are you using? On what operating system?
MarkerClusterer r1018. Windows Vista. Firefox 3.0.12.
Please provide any additional information below.
Original issue reported on code.google.com by Ben.Talberg on 31 Jul 2009 at 6:59
Original issue reported on code.google.com by
Ben.Talberg
on 31 Jul 2009 at 6:59