markerclustererplus-rails 2.1.6 → 2.1.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3b32e8a6734028fe39f2478a8ea5660a738152c2beee31a2a48ce60fabd4387
4
- data.tar.gz: cd1cc98d44e2d54c2d2fb1e169c3b17a31f81f2216f26fd0cd81ee27ff25af0e
3
+ metadata.gz: b5f00481294f90a206a80a5040904c7aac816d83918ca05b75f646c4dcad516f
4
+ data.tar.gz: 433bfe00a960b076ab7fd6ccad391f372ce573de50e252ebf06c163d0c09466a
5
5
  SHA512:
6
- metadata.gz: 581d16abe06c4d41c7538037a078dc504162bdafa91e79f5e9a863cb6089d8c437fc543fe7437e546b30f52cf0b7f215731407168f3c24fdcc73ec97557f6ca8
7
- data.tar.gz: 54a40e6c7893492fd5941005ef439c05ef6060f77c0530933df048689e705ecd6347bb30d5cb370470aa4b33496f5d0aaaf757d8fc45d1e52b22546d2ad4968f
6
+ metadata.gz: 6567fcd986e750f0366b1274275cdb23a65fd14efca975dc2e9e8500d4750f0d911d184b2925ab27a32ee31a03e9b7b23e5b085b03026597a8084120050618bd
7
+ data.tar.gz: 7f79209968fca8ad370324b2abf9167b5d1b3ad70b596d7800e20162da9f05b9c75da106015e92a2de06ed8e1d51782c51de02914d15e4ec6a800c40acf0b0b1
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @name MarkerClustererPlus for Google Maps V3
3
- * @version 2.1.6 [February 19, 2018]
3
+ * @version 2.1.7 [March 3, 2018]
4
4
  * @author Gary Little
5
5
  * @fileoverview
6
6
  * The library creates and manages per-zoom-level clusters for large amounts of markers.
@@ -23,7 +23,7 @@
23
23
  * This file modified for use with the Rails asset pipeline
24
24
  * https://github.com/RogerE/markerclustererplus-rails
25
25
  * gem markerclustererplus-rails
26
- * gem version 2.1.6
26
+ * gem version 2.1.7
27
27
  * @author Roger Ertesvag
28
28
  * NOTE: to include the MarkerClustererPlus icons in the asset pipeline the gem overrides
29
29
  * the original configuration for setting the icon properties. This means that changing
@@ -145,6 +145,11 @@ ClusterIcon.prototype.onAdd = function () {
145
145
  cMouseDownInCluster = true;
146
146
  cDraggingMapByCluster = false;
147
147
  });
148
+
149
+ // March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522
150
+ google.maps.event.addDomListener(this.div_, "touchstart", function (e) {
151
+ e.stopPropagation();
152
+ });
148
153
 
149
154
  google.maps.event.addDomListener(this.div_, "click", function (e) {
150
155
  cMouseDownInCluster = false;
@@ -748,20 +753,25 @@ MarkerClusterer.prototype.onAdd = function () {
748
753
  this.ready_ = true;
749
754
 
750
755
  this.repaint();
756
+
757
+ this.prevZoom_ = this.getMap().getZoom();
751
758
 
752
759
  // Add the map event listeners
753
760
  this.listeners_ = [
754
761
  google.maps.event.addListener(this.getMap(), "zoom_changed", function () {
755
- cMarkerClusterer.resetViewport_(false);
756
- // Workaround for this Google bug: when map is at level 0 and "-" of
757
- // zoom slider is clicked, a "zoom_changed" event is fired even though
758
- // the map doesn't zoom out any further. In this situation, no "idle"
759
- // event is triggered so the cluster markers that have been removed
760
- // do not get redrawn. Same goes for a zoom in at maxZoom.
761
- if (this.getZoom() === (this.get("minZoom") || 0) || this.getZoom() === this.get("maxZoom")) {
762
- google.maps.event.trigger(this, "idle");
762
+ // Fix for bug #407
763
+ // Determines map type and prevents illegal zoom levels
764
+ var zoom = this.getMap().getZoom();
765
+ var minZoom = this.getMap().minZoom || 0;
766
+ var maxZoom = Math.min(this.getMap().maxZoom || 100,
767
+ this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);
768
+ zoom = Math.min(Math.max(zoom,minZoom),maxZoom);
769
+
770
+ if (this.prevZoom_ != zoom) {
771
+ this.prevZoom_ = zoom;
772
+ this.resetViewport_(false);
763
773
  }
764
- }),
774
+ }.bind(this)),
765
775
  google.maps.event.addListener(this.getMap(), "idle", function () {
766
776
  cMarkerClusterer.redraw_();
767
777
  })
@@ -846,7 +856,10 @@ MarkerClusterer.prototype.fitMapToMarkers = function () {
846
856
  var markers = this.getMarkers();
847
857
  var bounds = new google.maps.LatLngBounds();
848
858
  for (i = 0; i < markers.length; i++) {
849
- bounds.extend(markers[i].getPosition());
859
+ // March 3, 2018: Bug fix -- honor the ignoreHidden property
860
+ if (markers[i].getVisible() || !this.getIgnoreHidden()) {
861
+ bounds.extend(markers[i].getPosition());
862
+ }
850
863
  }
851
864
 
852
865
  this.getMap().fitBounds(bounds);
@@ -1,5 +1,5 @@
1
1
  module Markerclustererplus
2
2
  module Rails
3
- VERSION = "2.1.6"
3
+ VERSION = "2.1.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markerclustererplus-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - RogerE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-06 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem provides the MarkerClustererPlus assets for your Rails application.
14
14
  email: