autumn_rails 0.0.2 → 0.0.3
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 +4 -4
- data/app/assets/javascripts/jquery.autumn.js +16 -16
- data/lib/autumn_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39adc6dc990198ecc139509a6e0feaa7844a844f
|
4
|
+
data.tar.gz: bbba07b711c46a2d0c38e9df5a6f5644b496d64c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f078c67e99f91c916ed7c7a8887b3678beab07128078db7a6d44d3882b12702a6be2e9c31eead093f9585c801882311f73c2a432397a17ed3b128f7048c2b8a4
|
7
|
+
data.tar.gz: 3dc3f082c6f2f3b4a30f0063a93a6740387037c638582ad9316e1817d20638a351a481d010c9c1fad07d6eed969ea08ac14380b9c9ae496bb684697f3687a677
|
@@ -1,6 +1,7 @@
|
|
1
|
-
/*! autumn - v0.0.
|
1
|
+
/*! autumn - v0.0.3 - 2014-07-06
|
2
2
|
* https://github.com/guyisra/autumn
|
3
3
|
* Copyright (c) 2014 Guy Israeli; Licensed MIT */
|
4
|
+
|
4
5
|
// the semi-colon before function invocation is a safety net against concatenated
|
5
6
|
// scripts and/or other plugins which may not be closed properly.
|
6
7
|
;(function ( $, window, document, undefined ) {
|
@@ -8,15 +9,13 @@
|
|
8
9
|
// Create the defaults once
|
9
10
|
var pluginName = "autumn",
|
10
11
|
defaults = {
|
11
|
-
|
12
|
-
scrollWheenZoom: false,
|
12
|
+
scrollWheelZoom: false,
|
13
13
|
center: [51.1788, -1.8262], //stonehenge, that's why
|
14
14
|
maxZoom: 18,
|
15
15
|
tiles_url: "http://{s}.tiles.mapbox.com/v3/<MAP ID>/{z}/{x}/{y}.png",
|
16
16
|
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>'
|
17
|
-
}
|
18
|
-
|
19
|
-
layer = new L.featureGroup(); // TODO this better...
|
17
|
+
};
|
18
|
+
|
20
19
|
|
21
20
|
// The actual plugin constructor
|
22
21
|
function Autumn ( element, options ) {
|
@@ -29,21 +28,22 @@
|
|
29
28
|
|
30
29
|
Autumn.prototype = {
|
31
30
|
init: function () {
|
32
|
-
map = L.map(this.element.id,this.options).setView(this.options.center, 17);
|
31
|
+
var map = L.map(this.element.id,this.options).setView(this.options.center, 17);
|
33
32
|
this._map = map;
|
33
|
+
this.layer = new L.featureGroup(); // TODO this better...
|
34
34
|
L.tileLayer(this.options.tiles_url, { attribution: this.options.attribution, maxZoom: this.options.maxZoom
|
35
35
|
}).addTo(map);
|
36
36
|
},
|
37
37
|
addMarker: function ( latLng, name) {
|
38
|
-
L.marker(latLng).addTo(
|
38
|
+
L.marker(latLng).addTo(this._map);
|
39
39
|
},
|
40
40
|
deleteMarkers: function(layerToRemove){
|
41
41
|
if (layerToRemove){
|
42
|
-
|
42
|
+
this._map.removeLayer(layerToRemove);
|
43
43
|
}
|
44
44
|
else{
|
45
|
-
|
46
|
-
layer = new L.featureGroup();
|
45
|
+
this._map.removeLayer(this.layer);
|
46
|
+
this.layer = new L.featureGroup();
|
47
47
|
}
|
48
48
|
}
|
49
49
|
};
|
@@ -76,8 +76,8 @@
|
|
76
76
|
case 'addMarker':
|
77
77
|
var coord = (options.marker);
|
78
78
|
var marker = L.marker(coord);
|
79
|
-
marker.addTo(layer);
|
80
|
-
layer.addTo(
|
79
|
+
marker.addTo(a.layer);
|
80
|
+
a.layer.addTo(a._map);
|
81
81
|
return marker;
|
82
82
|
case 'addMarkers':
|
83
83
|
var coords = options.markers;
|
@@ -85,15 +85,15 @@
|
|
85
85
|
$.each(coords, function(index){
|
86
86
|
var marker = L.marker(this);
|
87
87
|
markers.push(marker);
|
88
|
-
marker.addTo(layer);
|
88
|
+
marker.addTo(a.layer);
|
89
89
|
});
|
90
|
-
layer.addTo(
|
90
|
+
a.layer.addTo(a._map);
|
91
91
|
return this;
|
92
92
|
case 'deleteMarkers':
|
93
93
|
a.deleteMarkers();
|
94
94
|
return this;
|
95
95
|
case 'fitMarkers':
|
96
|
-
|
96
|
+
a._map.fitBounds(a.layer.getBounds(), {maxZoom: 16});
|
97
97
|
return this;
|
98
98
|
}
|
99
99
|
|
data/lib/autumn_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autumn_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Israeli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|