leaflet-rails 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/leaflet-rails/version.rb +1 -1
- data/vendor/assets/javascripts/leaflet.js.erb +21 -32
- metadata +3 -2
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
var oldL = window.L,
|
8
8
|
L = {};
|
9
9
|
|
10
|
-
L.version = '0.7';
|
10
|
+
L.version = '0.7.1';
|
11
11
|
|
12
12
|
// define Leaflet for Node module pattern loaders, including Browserify
|
13
13
|
if (typeof module === 'object' && typeof module.exports === 'object') {
|
@@ -134,21 +134,16 @@ L.Util = {
|
|
134
134
|
}
|
135
135
|
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
|
136
136
|
},
|
137
|
-
|
138
|
-
compileTemplate: function (str, data) {
|
139
|
-
// based on https://gist.github.com/padolsey/6008842
|
140
|
-
str = str.replace(/"/g, '\\\"');
|
141
|
-
str = str.replace(/\{ *([\w_]+) *\}/g, function (str, key) {
|
142
|
-
return '" + o["' + key + '"]' + (typeof data[key] === 'function' ? '(o)' : '') + ' + "';
|
143
|
-
});
|
144
|
-
// jshint evil: true
|
145
|
-
return new Function('o', 'return "' + str + '";');
|
146
|
-
},
|
147
|
-
|
148
137
|
template: function (str, data) {
|
149
|
-
|
150
|
-
|
151
|
-
|
138
|
+
return str.replace(/\{ *([\w_]+) *\}/g, function (str, key) {
|
139
|
+
var value = data[key];
|
140
|
+
if (value === undefined) {
|
141
|
+
throw new Error('No value provided for variable ' + str);
|
142
|
+
} else if (typeof value === 'function') {
|
143
|
+
value = value(data);
|
144
|
+
}
|
145
|
+
return value;
|
146
|
+
});
|
152
147
|
},
|
153
148
|
|
154
149
|
isArray: Array.isArray || function (obj) {
|
@@ -534,7 +529,7 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent;
|
|
534
529
|
|
535
530
|
doc = document.documentElement,
|
536
531
|
ie3d = ie && ('transition' in doc.style),
|
537
|
-
webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()),
|
532
|
+
webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23,
|
538
533
|
gecko3d = 'MozPerspective' in doc.style,
|
539
534
|
opera3d = 'OTransition' in doc.style,
|
540
535
|
any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d) && !phantomjs;
|
@@ -1070,11 +1065,6 @@ L.DomUtil = {
|
|
1070
1065
|
|
1071
1066
|
if (!disable3D && L.Browser.any3d) {
|
1072
1067
|
el.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString(point);
|
1073
|
-
|
1074
|
-
// workaround for Android 2/3 stability (https://github.com/CloudMade/Leaflet/issues/69)
|
1075
|
-
if (L.Browser.mobileWebkit3d) {
|
1076
|
-
el.style.WebkitBackfaceVisibility = 'hidden';
|
1077
|
-
}
|
1078
1068
|
} else {
|
1079
1069
|
el.style.left = point.x + 'px';
|
1080
1070
|
el.style.top = point.y + 'px';
|
@@ -1770,6 +1760,8 @@ L.Map = L.Class.extend({
|
|
1770
1760
|
},
|
1771
1761
|
|
1772
1762
|
invalidateSize: function (options) {
|
1763
|
+
if (!this._loaded) { return this; }
|
1764
|
+
|
1773
1765
|
options = L.extend({
|
1774
1766
|
animate: false,
|
1775
1767
|
pan: true
|
@@ -1779,8 +1771,6 @@ L.Map = L.Class.extend({
|
|
1779
1771
|
this._sizeChanged = true;
|
1780
1772
|
this._initialCenter = null;
|
1781
1773
|
|
1782
|
-
if (!this._loaded) { return this; }
|
1783
|
-
|
1784
1774
|
var newSize = this.getSize(),
|
1785
1775
|
oldCenter = oldSize.divideBy(2).round(),
|
1786
1776
|
newCenter = newSize.divideBy(2).round(),
|
@@ -2857,11 +2847,9 @@ L.TileLayer = L.Class.extend({
|
|
2857
2847
|
/*
|
2858
2848
|
Chrome 20 layouts much faster with top/left (verify with timeline, frames)
|
2859
2849
|
Android 4 browser has display issues with top/left and requires transform instead
|
2860
|
-
Android 2 browser requires top/left or tiles disappear on load or first drag
|
2861
|
-
(reappear after zoom) https://github.com/CloudMade/Leaflet/issues/866
|
2862
2850
|
(other browsers don't currently care) - see debug/hacks/jitter.html for an example
|
2863
2851
|
*/
|
2864
|
-
L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome
|
2852
|
+
L.DomUtil.setPosition(tile, tilePos, L.Browser.chrome);
|
2865
2853
|
|
2866
2854
|
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;
|
2867
2855
|
|
@@ -4479,10 +4467,10 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
4479
4467
|
},
|
4480
4468
|
|
4481
4469
|
_propagateEvent: function (e) {
|
4482
|
-
e = L.extend({
|
4470
|
+
e = L.extend({
|
4483
4471
|
layer: e.target,
|
4484
4472
|
target: this
|
4485
|
-
});
|
4473
|
+
}, e);
|
4486
4474
|
this.fire(e.type, e);
|
4487
4475
|
}
|
4488
4476
|
});
|
@@ -5253,7 +5241,7 @@ L.Map.include((L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? {}
|
|
5253
5241
|
* and polylines (clipping, simplification, distances, etc.)
|
5254
5242
|
*/
|
5255
5243
|
|
5256
|
-
/*jshint bitwise:false */ // allow bitwise
|
5244
|
+
/*jshint bitwise:false */ // allow bitwise operations for this file
|
5257
5245
|
|
5258
5246
|
L.LineUtil = {
|
5259
5247
|
|
@@ -5986,6 +5974,7 @@ L.CircleMarker = L.Circle.extend({
|
|
5986
5974
|
if (this._popup && this._popup._isOpen) {
|
5987
5975
|
this._popup.setLatLng(latlng);
|
5988
5976
|
}
|
5977
|
+
return this;
|
5989
5978
|
},
|
5990
5979
|
|
5991
5980
|
setRadius: function (radius) {
|
@@ -6767,7 +6756,7 @@ L.Draggable = L.Class.extend({
|
|
6767
6756
|
L.DomUtil.enableImageDrag();
|
6768
6757
|
L.DomUtil.enableTextSelection();
|
6769
6758
|
|
6770
|
-
if (this._moved) {
|
6759
|
+
if (this._moved && this._moving) {
|
6771
6760
|
// ensure drag is not fired after dragend
|
6772
6761
|
L.Util.cancelAnimFrame(this._animRequest);
|
6773
6762
|
|
@@ -8901,8 +8890,8 @@ if (L.DomUtil.TRANSITION) {
|
|
8901
8890
|
|
8902
8891
|
L.Map.include(!L.DomUtil.TRANSITION ? {} : {
|
8903
8892
|
|
8904
|
-
_catchTransitionEnd: function () {
|
8905
|
-
if (this._animatingZoom) {
|
8893
|
+
_catchTransitionEnd: function (e) {
|
8894
|
+
if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {
|
8906
8895
|
this._onZoomTransitionEnd();
|
8907
8896
|
}
|
8908
8897
|
},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leaflet-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -163,3 +163,4 @@ summary: Use leaflet.js with Rails 3/4.
|
|
163
163
|
test_files:
|
164
164
|
- spec/spec_helper.rb
|
165
165
|
- spec/view_helpers_spec.rb
|
166
|
+
has_rdoc:
|