markerclustererplus-rails 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -5,13 +5,13 @@ The files will be added to the asset pipeline and available for you to use.
5
5
 
6
6
  For info on how to use the library see the original documentation:
7
7
 
8
- [MarkerClustererPlus for Google Maps V3](http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0/docs/reference.html)
8
+ [MarkerClustererPlus for Google Maps V3](http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.1/docs/reference.html)
9
9
 
10
10
  ## Installation
11
11
 
12
12
  In your Gemfile, add this line:
13
13
 
14
- gem "markerclustererplus-rails"
14
+ gem 'markerclustererplus-rails'
15
15
 
16
16
  You can include it by adding the following to your javascript file:
17
17
 
@@ -1,5 +1,5 @@
1
1
  module Markerclustererplus
2
2
  module Rails
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  /**
5
5
  * @name MarkerClustererPlus for Google Maps V3
6
- * @version 2.0 [July 20, 2011]
6
+ * @version 2.0.1 [July 27, 2011]
7
7
  * @author Gary Little
8
8
  * @fileoverview
9
9
  * The library creates and manages per-zoom-level clusters for large amounts of markers.
@@ -460,15 +460,22 @@ Cluster.prototype.addMarker = function (marker) {
460
460
  this.markers_.push(marker);
461
461
 
462
462
  mCount = this.markers_.length;
463
- if (mCount < this.minClusterSize_ && marker.getMap() !== this.map_) {
463
+ if (this.map_.getZoom() > this.markerClusterer_.getMaxZoom()) {
464
+ // Zoomed in past max zoom, so show the marker.
465
+ if (marker.getMap() !== this.map_) {
466
+ marker.setMap(this.map_);
467
+ }
468
+ } else if (mCount < this.minClusterSize_) {
464
469
  // Min cluster size not reached so show the marker.
465
- marker.setMap(this.map_);
470
+ if (marker.getMap() !== this.map_) {
471
+ marker.setMap(this.map_);
472
+ }
466
473
  } else if (mCount === this.minClusterSize_) {
467
474
  // Hide the markers that were showing.
468
475
  for (i = 0; i < mCount; i++) {
469
476
  this.markers_[i].setMap(null);
470
477
  }
471
- } else if (mCount > this.minClusterSize_) {
478
+ } else {
472
479
  marker.setMap(null);
473
480
  }
474
481
 
@@ -502,14 +509,9 @@ Cluster.prototype.calculateBounds_ = function () {
502
509
  * Updates the cluster icon.
503
510
  */
504
511
  Cluster.prototype.updateIcon_ = function () {
505
- var i;
506
512
  var mCount = this.markers_.length;
507
513
 
508
514
  if (this.map_.getZoom() > this.markerClusterer_.getMaxZoom()) {
509
- // The zoom is greater than our max zoom so show all the markers in cluster.
510
- for (i = 0; i < mCount; i++) {
511
- this.markers_[i].setMap(this.map_);
512
- }
513
515
  this.clusterIcon_.hide();
514
516
  return;
515
517
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markerclustererplus-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 1
10
+ version: 2.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - RogerE
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-01 00:00:00 Z
18
+ date: 2012-03-02 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: This gem provides the MarkerClustererPlus assets for your Rails application.