Evolution of Jef Poskanzer Clusterer for Google Maps API V3 compliance
melicerte / clusterer Goto Github PK
View Code? Open in Web Editor NEWEvolution of Jef's Poskanzer Clusterer for Google Maps API V3 compliance
Evolution of Jef's Poskanzer Clusterer for Google Maps API V3 compliance
I'm using Drupal 7.22 with GMap 7x-2.7 and Location 7x-3.0-rc1 modules, and Jef Poskanzer's Clusterer in the 'thirdparty' folder.
When displaying node map there is no problem with using no marker manager at all (apart from nodes at same location being immediately one behind the other)
There are problems when I use Clusterer.
Where there are clusters everything work fine, but where there are no clusters instead of the title of the node appearing on hover I am seeing the whole URL as in the attached image.
Clusterer.PopUp = function(cluster){
var clusterer = cluster.clusterer;
var html = '<table width="300">';
var n = 0;
for (var i = 0; i < cluster.markers.length; ++i){
var marker = cluster.markers[i];
if (marker != null){
++n;
var icon_marker = marker.getIcon();
html += '<tr><td>';
html += '<img src="' + icon_marker.url + '" width="' + (icon_marker.size.width / 2) + '" height="' + (icon_marker.size.height / 2) + '">';
If marker.getIcon() returns undefined, the method will blow up like this:
Uncaught TypeError: Cannot read property 'url' of undefined
This method fires a cluster is being clicked.
See also Clusterer2.js: marker.getIcon() returns null, and Clusterer.PopUp() blows up. in the drupal.org GMap issue queue.
I expect this is not an either-or, but both the Drupal module and the clusterer should add some sanity checks for early problem detection.
Btw, I remember having used the clusterer successfully in past projects, and having been happy with it. So something must have changed in the clusterer or in the Drupal module, or my setup is not correct. But even if my setup is not correct, adding some sanity checks can't be wrong.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.