kstukstu / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
0 stars 0 forks source link

MarkerClusterer not functioning #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Demo link or sample code:
http://google-maps-utility-library-
v3.googlecode.com/svn/tags/markerclusterer/1.0/examples/advanced_example.html

What steps will reproduce the problem?
1. open the (official) demo link as provided above
2. javascript errors occur, on line 838 of markerclusterer.js

Expected result:
Clusters like in http://gmaps-samples-
v3.googlecode.com/svn/trunk/screenshots/markerclusterer.png

Actual result:
No clusters are shown at all.

Version: 1.0

Browser / Operating System:
IE8,FF3,Chrome4 / Windows XP,7

Additional comments:
In every browser tried, errors like "Uncaught
TypeError: Cannot call method 'fromLatLngToDivPixel' of undefined" are 
occuring, at line 
838 of markerclusterer.js. I hope somebody knows how to fix this.

Gerben

Original issue reported on code.google.com by gerben.meyer on 12 May 2010 at 11:44

GoogleCodeExporter commented 9 years ago
You can resolve this by changing the line
var pos = this.projection.fromLatLngToDivPixel(latlng);
to
var pos = this.getProjection().fromLatLngToDivPixel(latlng);
in ClusterIcon.prototype.getPosFromLatLng_

... this may be due to a change in the OverlayView part of the API or 
something...

Original comment by fri...@gmail.com on 12 May 2010 at 2:33

GoogleCodeExporter commented 9 years ago
Just to second the suggestion by friism - in the
ClusterIcon.prototype.getPosFromLatLng() function of markerclusterer.js, change 
the
"...this.projection..." line to be "...this.getProjection()...".

Apparently the projection variable was never meant to be exposed, and was taken 
away
in the release on 11th May, according to this thread:

http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/072fbd
406d9f4629

Original comment by adam.car...@gmail.com on 13 May 2010 at 8:42

GoogleCodeExporter commented 9 years ago
sorry, typo above. The function is ClusterIcon.prototype.getPosFromLatLng_ , as
friism said.

Original comment by adam.car...@gmail.com on 13 May 2010 at 8:54

GoogleCodeExporter commented 9 years ago
I am still getting issues in Firefox on the examples page: 
http://google-maps-utility-library-v3.googlecode.com/svn-history/r88/trunk/marke
rclusterer/examples/advanced_example.html?

firebug:
this.projection is undefined
var pos = this.projection.fromLatLngToDivPixel(latlng); 
markerclusterer.js (line 830)

I have not tried the fix mentioned in the comments yet.  If this is such an 
easy fix, why can't a committer fix it?

Original comment by theplaz....@gmail.com on 23 Jul 2010 at 9:06

GoogleCodeExporter commented 9 years ago
I tried the fix.  Now the map is not loading - it loads the gray background, 
but nothing more, and then hangs.  I get a JS timeout in the main map API in 
Firefox, without any errors.  I've tried commenting a lot of stuff out, 
including data and markercluster so IDK - might be an unrelated bug.

I'm still having issues on the example page as well:
too much recursion
function md(a){return function(b){if(!... ("+(c[jc](" | ")+")")))));return k}}
main.js (line 16)

I am thinking I should just stick with v2....

Original comment by theplaz....@gmail.com on 23 Jul 2010 at 10:31

GoogleCodeExporter commented 9 years ago
Ok, so the map not loading was me passing in undefined/null when setting the 
center.  (Sorry for spamming, but I did not want anyone investigating it) 

I have markercluster working in v3 now.  It does not feel faster/better - but I 
am going to set v2 up in parallel and do some benchmarks.

Original comment by theplaz....@gmail.com on 23 Jul 2010 at 12:48

GoogleCodeExporter commented 9 years ago
This was fixed a while ago, I just forgot to check the issue tracker :)

Original comment by lu...@google.com on 31 Aug 2010 at 1:39