markerclustererplus-rails 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,7 +5,7 @@ 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.7/docs/reference.html)
8
+ [MarkerClustererPlus for Google Maps V3](http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.8/docs/reference.html)
9
9
 
10
10
  ## Installation
11
11
 
@@ -1,5 +1,5 @@
1
1
  module Markerclustererplus
2
2
  module Rails
3
- VERSION = "2.0.7"
3
+ VERSION = "2.0.8"
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.7 [December 28, 2011]
6
+ * @version 2.0.8 [February 9, 2012]
7
7
  * @author Gary Little
8
8
  * @fileoverview
9
9
  * The library creates and manages per-zoom-level clusters for large amounts of markers.
@@ -122,6 +122,8 @@ function ClusterIcon(cluster, styles) {
122
122
  */
123
123
  ClusterIcon.prototype.onAdd = function () {
124
124
  var cClusterIcon = this;
125
+ var cMouseDownInCluster;
126
+ var cDraggingMapByCluster;
125
127
 
126
128
  this.div_ = document.createElement("div");
127
129
  if (this.visible_) {
@@ -130,34 +132,47 @@ ClusterIcon.prototype.onAdd = function () {
130
132
 
131
133
  this.getPanes().overlayMouseTarget.appendChild(this.div_);
132
134
 
135
+ // Fix for Issue 157
136
+ google.maps.event.addListener(this.getMap(), "bounds_changed", function () {
137
+ cDraggingMapByCluster = cMouseDownInCluster;
138
+ });
139
+
140
+ google.maps.event.addDomListener(this.div_, "mousedown", function () {
141
+ cMouseDownInCluster = true;
142
+ cDraggingMapByCluster = false;
143
+ });
144
+
133
145
  google.maps.event.addDomListener(this.div_, "click", function (e) {
134
- var mz;
135
- var mc = cClusterIcon.cluster_.getMarkerClusterer();
136
- /**
137
- * This event is fired when a cluster marker is clicked.
138
- * @name MarkerClusterer#click
139
- * @param {Cluster} c The cluster that was clicked.
140
- * @event
141
- */
142
- google.maps.event.trigger(mc, "click", cClusterIcon.cluster_);
143
- google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_); // deprecated name
144
-
145
- // The default click handler follows. Disable it by setting
146
- // the zoomOnClick property to false.
147
- if (mc.getZoomOnClick()) {
148
- // Zoom into the cluster.
149
- mz = mc.getMaxZoom();
150
- mc.getMap().fitBounds(cClusterIcon.cluster_.getBounds());
151
- // Don't zoom beyond the max zoom level
152
- if (mz !== null && (mc.getMap().getZoom() > mz)) {
153
- mc.getMap().setZoom(mz + 1);
146
+ cMouseDownInCluster = false;
147
+ if (!cDraggingMapByCluster) {
148
+ var mz;
149
+ var mc = cClusterIcon.cluster_.getMarkerClusterer();
150
+ /**
151
+ * This event is fired when a cluster marker is clicked.
152
+ * @name MarkerClusterer#click
153
+ * @param {Cluster} c The cluster that was clicked.
154
+ * @event
155
+ */
156
+ google.maps.event.trigger(mc, "click", cClusterIcon.cluster_);
157
+ google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_); // deprecated name
158
+
159
+ // The default click handler follows. Disable it by setting
160
+ // the zoomOnClick property to false.
161
+ if (mc.getZoomOnClick()) {
162
+ // Zoom into the cluster.
163
+ mz = mc.getMaxZoom();
164
+ mc.getMap().fitBounds(cClusterIcon.cluster_.getBounds());
165
+ // Don't zoom beyond the max zoom level
166
+ if (mz !== null && (mc.getMap().getZoom() > mz)) {
167
+ mc.getMap().setZoom(mz + 1);
168
+ }
154
169
  }
155
- }
156
170
 
157
- // Prevent event propagation to the map:
158
- e.cancelBubble = true;
159
- if (e.stopPropagation) {
160
- e.stopPropagation();
171
+ // Prevent event propagation to the map:
172
+ e.cancelBubble = true;
173
+ if (e.stopPropagation) {
174
+ e.stopPropagation();
175
+ }
161
176
  }
162
177
  });
163
178
 
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: 1
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 7
10
- version: 2.0.7
9
+ - 8
10
+ version: 2.0.8
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-06 00:00:00 Z
18
+ date: 2012-03-07 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: This gem provides the MarkerClustererPlus assets for your Rails application.