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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6eb3e82714c6e1b903642060c224f8898055a5d4
4
- data.tar.gz: 21aa6f7bb099afb78bf6d9aa214b09d07c6dfd03
3
+ metadata.gz: e7561ddb7e1dd2d6f343996d5137dd6aeabdd9d8
4
+ data.tar.gz: 2aa972e9c09e6391f053f9f9b9757f83f159a8fd
5
5
  SHA512:
6
- metadata.gz: 4ec11155789a6576e527da8b18cff34c62926142dbfec0ef27e4721e54db92d147e33efea2322acc0f877756eac44aaefd3bf5329616576cba589ba92135b11b
7
- data.tar.gz: e1c2f3443c56cfeefb7e5c1dd50fcf63a42db344ea27dfd9e1ef6573eda27a9ee81a8d737550d66f0d3296773ff0cfc3342bc9d6854c454bb7463f4ac1c105b0
6
+ metadata.gz: 7c418b067ba961e04eb0ab08f6850bdaa3dbb672ff875ff6e16ee6c02df012f8122f9dc0ef0adb7b55c508588d5c9d8a74952987bbb7db7d6990a691cbc0f074
7
+ data.tar.gz: 40b58981844260441e7e914fea3a7926c947864ccbeae2d03a450bec969410fe2908aacb3e8386d59435c00bd7b7258d44f4001b78f4653c5dc2f5d82c1bae82
@@ -1,4 +1,4 @@
1
- /*! autumn - v0.0.1 - 2014-07-02
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: 10,
14
+ maxZoom: 18,
15
15
  tiles_url: "http://{s}.tiles.mapbox.com/v3/<MAP ID>/{z}/{x}/{y}.png",
16
16
  attribution: 'Map data &copy; <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.layerGroup(); // TODO this better...
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(layerGroup){
41
- if (layerGroup){
42
- map.removeLayer(layerGroup)
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.LayerGroup();
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 markers; // marker: {latLng, }
78
- if (!$.isArray(options.markers[0])){ //single markers
79
- if (typeof(options.markers[0]) == "string"){
80
- markers = [JSON.parse(options.markers)];
81
- }
82
- else{
83
- markers = [options.markers];
84
- }
85
- }
86
- else{
87
- markers = options.markers; //many 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
  };
@@ -1,3 +1,3 @@
1
1
  module AutumnRails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-02 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler