diff --git a/src/markerclusterer.js b/src/markerclusterer.js index 554fcec..d7b3ad2 100755 --- a/src/markerclusterer.js +++ b/src/markerclusterer.js @@ -695,7 +695,7 @@ MarkerClusterer.prototype.repaint = function() { // Remove the old clusters. // Do it in a timeout so the other clusters have been drawn first. - window.setTimeout(function() { + setTimeout(function() { for (var i = 0, cluster; cluster = oldClusters[i]; i++) { cluster.remove(); } @@ -1267,7 +1267,9 @@ ClusterIcon.prototype.createCss = function(pos) { // Export Symbols for Closure // If you are not going to compile with closure then you can remove the // code below. -window['MarkerClusterer'] = MarkerClusterer; +if (typeof window !== 'undefined') { + window['MarkerClusterer'] = MarkerClusterer; +} MarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker; MarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers; MarkerClusterer.prototype['clearMarkers'] =