e_markerclusterer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1489323debd64bfb939394b1bdc427c31351e98
4
- data.tar.gz: 15d65bb4366e620b7b585a2c8a6e5e025b15023f
3
+ metadata.gz: adb8964e0a1d00b825c188f308350747b7212eda
4
+ data.tar.gz: b0fddf464e27d75b54dfa3d9b930e33e45653c9d
5
5
  SHA512:
6
- metadata.gz: b5c07bf56fd4ed292ee2e60d10f4a1ea680f52c93ccba2ece944e02a962394644374d0ff2c1eef8c2b6b457423d2a6c83952a582ecd369b1515baffb72306162
7
- data.tar.gz: 3e54885a102f6bbaac0666fb3440224f134c139820687d9eb95be7e03f513a894f4aef8784e2f3f45d8db915321f24122c31c5e6feb56a5f8636ee2ac70d8209
6
+ metadata.gz: a6b5c734018423ede5c883a02df7c40495ba0ef81670b48788978df23b9e1139a446fa1acdc8eb04818dbbd4119b2eea975407f64881ebf14c52999f812bb142
7
+ data.tar.gz: 4d7ea8b93567b2c3ee823e03736e25a321bef7bff98519de2e4be9f59d85497116a82b2464d59e096f4652635c90caa1c5588e8ce36486ed663b98a4ee5ce908
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  Note: This is in reverse chronological order, so newer entries are added to the top.
2
2
 
3
+ ## Enhanced MarkerClusterer 0.0.5
4
+
5
+ ######2016. 8. 1
6
+ * A bug not to show a chart of last created cluster is fixed.
7
+
3
8
  ## Enhanced MarkerClusterer 0.0.4
4
9
 
5
10
  ######2016. 7. 25
@@ -1635,7 +1635,7 @@ MarkerClusterer.prototype.getExtendedBounds = function (bounds) {
1635
1635
  * Redraws all the clusters.
1636
1636
  */
1637
1637
  MarkerClusterer.prototype.redraw_ = function () {
1638
- this.createClusters_(0);
1638
+ this.createClusters_();
1639
1639
  };
1640
1640
 
1641
1641
 
@@ -1736,31 +1736,95 @@ MarkerClusterer.prototype.addToClosestCluster_ = function (marker) {
1736
1736
  * @param {number} iFirst The index of the first marker in the batch of
1737
1737
  * markers to be added to clusters.
1738
1738
  */
1739
- MarkerClusterer.prototype.createClusters_ = function (iFirst) {
1740
- var i, marker;
1741
- var mapBounds;
1739
+ //MarkerClusterer.prototype.createClusters_ = function (iFirst) {
1740
+ // var i, marker;
1741
+ // var mapBounds;
1742
+ // var cMarkerClusterer = this;
1743
+ // if (!this.ready_) {
1744
+ // return;
1745
+ // }
1746
+ //
1747
+ // // Cancel previous batch processing if we're working on the first batch:
1748
+ // if (iFirst === 0) {
1749
+ // /**
1750
+ // * This event is fired when the <code>MarkerClusterer</code> begins
1751
+ // * clustering markers.
1752
+ // * @name MarkerClusterer#clusteringbegin
1753
+ // * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1754
+ // * @event
1755
+ // */
1756
+ // google.maps.event.trigger(this, "clusteringbegin", this);
1757
+ //
1758
+ // if (typeof this.timerRefStatic !== "undefined") {
1759
+ // clearTimeout(this.timerRefStatic);
1760
+ // delete this.timerRefStatic;
1761
+ // }
1762
+ // }
1763
+ //
1764
+ // // Get our current map view bounds.
1765
+ // // Create a new bounds object so we don't affect the map.
1766
+ // //
1767
+ // // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:
1768
+ // if (this.getMap().getZoom() > 3) {
1769
+ // mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),
1770
+ // this.getMap().getBounds().getNorthEast());
1771
+ // } else {
1772
+ // mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
1773
+ // }
1774
+ // var bounds = this.getExtendedBounds(mapBounds);
1775
+ //
1776
+ // var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);
1777
+ //
1778
+ // for (i = iFirst; i < iLast; i++) {
1779
+ // marker = this.markers_[i];
1780
+ // if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
1781
+ // if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {
1782
+ // this.addToClosestCluster_(marker);
1783
+ // }
1784
+ // }
1785
+ // }
1786
+ //
1787
+ // if (iLast < this.markers_.length) {
1788
+ // this.timerRefStatic = setTimeout(function () {
1789
+ // cMarkerClusterer.createClusters_(iLast);
1790
+ // }, 0);
1791
+ // } else {
1792
+ // delete this.timerRefStatic;
1793
+ //
1794
+ // /**
1795
+ // * This event is fired when the <code>MarkerClusterer</code> stops
1796
+ // * clustering markers.
1797
+ // * @name MarkerClusterer#clusteringend
1798
+ // * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1799
+ // * @event
1800
+ // */
1801
+ // google.maps.event.trigger(this, "clusteringend", this);
1802
+ // }
1803
+ //};
1804
+ MarkerClusterer.prototype.createClusters_ = function () {
1742
1805
  var cMarkerClusterer = this;
1806
+
1743
1807
  if (!this.ready_) {
1744
1808
  return;
1745
1809
  }
1746
-
1747
- // Cancel previous batch processing if we're working on the first batch:
1748
- if (iFirst === 0) {
1749
- /**
1750
- * This event is fired when the <code>MarkerClusterer</code> begins
1751
- * clustering markers.
1752
- * @name MarkerClusterer#clusteringbegin
1753
- * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1754
- * @event
1755
- */
1756
- google.maps.event.trigger(this, "clusteringbegin", this);
1757
-
1758
- if (typeof this.timerRefStatic !== "undefined") {
1759
- clearTimeout(this.timerRefStatic);
1760
- delete this.timerRefStatic;
1810
+
1811
+ /**
1812
+ * This event is fired when the <code>MarkerClusterer</code> begins
1813
+ * clustering markers.
1814
+ * @name MarkerClusterer#clusteringbegin
1815
+ * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1816
+ * @event
1817
+ */
1818
+ google.maps.event.trigger(this, "clusteringbegin", this);
1819
+
1820
+ // set timers to cancel redundant jobs
1821
+ if (typeof this.timerRefs !== "undefined") {
1822
+ for (var i = 0; i < this.timerRefs.length; i++) {
1823
+ clearTimeout(this.timerRefs[i]);
1761
1824
  }
1825
+ delete this.timerRefs;
1762
1826
  }
1763
-
1827
+
1764
1828
  // Get our current map view bounds.
1765
1829
  // Create a new bounds object so we don't affect the map.
1766
1830
  //
@@ -1771,37 +1835,36 @@ MarkerClusterer.prototype.createClusters_ = function (iFirst) {
1771
1835
  } else {
1772
1836
  mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
1773
1837
  }
1774
- var bounds = this.getExtendedBounds(mapBounds);
1775
-
1776
- var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);
1777
-
1778
- for (i = iFirst; i < iLast; i++) {
1779
- marker = this.markers_[i];
1780
- if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
1781
- if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {
1782
- this.addToClosestCluster_(marker);
1838
+ var bounds = this.getExtendedBounds(mapBounds);
1839
+
1840
+ for (i = 0, s = 0, this.timerRefs = []; i < this.markers_.length; i += this.batchSize_, s++) {
1841
+ //this.timerRefStatic = setTimeout(this.createClustersCore_(bounds, i), 0);
1842
+ this.timerRefs[s] = setTimeout(function(position) {
1843
+ var marker;
1844
+
1845
+ var last = Math.min(position + cMarkerClusterer.batchSize_, cMarkerClusterer.markers_.length);
1846
+ for (var j = position; j < last; j++) {
1847
+ marker = cMarkerClusterer.markers_[j];
1848
+ if (!marker.isAdded && cMarkerClusterer.isMarkerInBounds_(marker, bounds)) {
1849
+ if (!cMarkerClusterer.ignoreHidden_ || (cMarkerClusterer.ignoreHidden_ && marker.getVisible())) {
1850
+ cMarkerClusterer.addToClosestCluster_(marker);
1851
+ }
1852
+ }
1783
1853
  }
1784
- }
1785
- }
1786
-
1787
- if (iLast < this.markers_.length) {
1788
- this.timerRefStatic = setTimeout(function () {
1789
- cMarkerClusterer.createClusters_(iLast);
1790
- }, 0);
1791
- } else {
1792
- delete this.timerRefStatic;
1793
-
1794
- /**
1795
- * This event is fired when the <code>MarkerClusterer</code> stops
1796
- * clustering markers.
1797
- * @name MarkerClusterer#clusteringend
1798
- * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1799
- * @event
1800
- */
1801
- google.maps.event.trigger(this, "clusteringend", this);
1854
+ }(i), 0)
1802
1855
  }
1803
- };
1804
-
1856
+
1857
+ delete this.timerRefs;
1858
+
1859
+ /**
1860
+ * This event is fired when the <code>MarkerClusterer</code> stops
1861
+ * clustering markers.
1862
+ * @name MarkerClusterer#clusteringend
1863
+ * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.
1864
+ * @event
1865
+ */
1866
+ google.maps.event.trigger(this, "clusteringend", this);
1867
+ }
1805
1868
 
1806
1869
  /**
1807
1870
  * Extends an object's prototype by another's.
@@ -1,3 +1,3 @@
1
1
  module EMarkerclusterer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e_markerclusterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sung Gon Yi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2016-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails