autumn_rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/jquery.autumn.js +23 -22
- 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: e7561ddb7e1dd2d6f343996d5137dd6aeabdd9d8
|
4
|
+
data.tar.gz: 2aa972e9c09e6391f053f9f9b9757f83f159a8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c418b067ba961e04eb0ab08f6850bdaa3dbb672ff875ff6e16ee6c02df012f8122f9dc0ef0adb7b55c508588d5c9d8a74952987bbb7db7d6990a691cbc0f074
|
7
|
+
data.tar.gz: 40b58981844260441e7e914fea3a7926c947864ccbeae2d03a450bec969410fe2908aacb3e8386d59435c00bd7b7258d44f4001b78f4653c5dc2f5d82c1bae82
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! autumn - v0.0.
|
1
|
+
/*! autumn - v0.0.2 - 2014-07-03
|
2
2
|
* https://github.com/guyisra/autumn
|
3
3
|
* Copyright (c) 2014 Guy Israeli; Licensed MIT */
|
4
4
|
// the semi-colon before function invocation is a safety net against concatenated
|
@@ -11,12 +11,12 @@
|
|
11
11
|
container: "map",
|
12
12
|
scrollWheenZoom: false,
|
13
13
|
center: [51.1788, -1.8262], //stonehenge, that's why
|
14
|
-
maxZoom:
|
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
17
|
},
|
18
18
|
map,
|
19
|
-
layer = new L.
|
19
|
+
layer = new L.featureGroup(); // TODO this better...
|
20
20
|
|
21
21
|
// The actual plugin constructor
|
22
22
|
function Autumn ( element, options ) {
|
@@ -37,13 +37,13 @@
|
|
37
37
|
addMarker: function ( latLng, name) {
|
38
38
|
L.marker(latLng).addTo(map);
|
39
39
|
},
|
40
|
-
deleteMarkers: function(
|
41
|
-
if (
|
42
|
-
map.removeLayer(
|
40
|
+
deleteMarkers: function(layerToRemove){
|
41
|
+
if (layerToRemove){
|
42
|
+
map.removeLayer(layerToRemove);
|
43
43
|
}
|
44
44
|
else{
|
45
45
|
map.removeLayer(layer);
|
46
|
-
layer = new L.
|
46
|
+
layer = new L.featureGroup();
|
47
47
|
}
|
48
48
|
}
|
49
49
|
};
|
@@ -74,26 +74,27 @@
|
|
74
74
|
}
|
75
75
|
});
|
76
76
|
case 'addMarker':
|
77
|
-
var
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
markers
|
88
|
-
|
89
|
-
$.each(markers, function(index){
|
90
|
-
L.marker(this).addTo(layer);
|
77
|
+
var coord = (options.marker);
|
78
|
+
var marker = L.marker(coord);
|
79
|
+
marker.addTo(layer);
|
80
|
+
layer.addTo(map);
|
81
|
+
return marker;
|
82
|
+
case 'addMarkers':
|
83
|
+
var coords = options.markers;
|
84
|
+
var markers = [];
|
85
|
+
$.each(coords, function(index){
|
86
|
+
var marker = L.marker(this);
|
87
|
+
markers.push(marker);
|
88
|
+
marker.addTo(layer);
|
91
89
|
});
|
92
|
-
layer.addTo(map)
|
90
|
+
layer.addTo(map);
|
93
91
|
return this;
|
94
92
|
case 'deleteMarkers':
|
95
93
|
a.deleteMarkers();
|
96
94
|
return this;
|
95
|
+
case 'fitMarkers':
|
96
|
+
map.fitBounds(layer.getBounds(), {maxZoom: 18});
|
97
|
+
return this;
|
97
98
|
}
|
98
99
|
|
99
100
|
};
|
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.2
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|