autumn_rails 0.0.2 → 0.0.3

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: e7561ddb7e1dd2d6f343996d5137dd6aeabdd9d8
4
- data.tar.gz: 2aa972e9c09e6391f053f9f9b9757f83f159a8fd
3
+ metadata.gz: 39adc6dc990198ecc139509a6e0feaa7844a844f
4
+ data.tar.gz: bbba07b711c46a2d0c38e9df5a6f5644b496d64c
5
5
  SHA512:
6
- metadata.gz: 7c418b067ba961e04eb0ab08f6850bdaa3dbb672ff875ff6e16ee6c02df012f8122f9dc0ef0adb7b55c508588d5c9d8a74952987bbb7db7d6990a691cbc0f074
7
- data.tar.gz: 40b58981844260441e7e914fea3a7926c947864ccbeae2d03a450bec969410fe2908aacb3e8386d59435c00bd7b7258d44f4001b78f4653c5dc2f5d82c1bae82
6
+ metadata.gz: f078c67e99f91c916ed7c7a8887b3678beab07128078db7a6d44d3882b12702a6be2e9c31eead093f9585c801882311f73c2a432397a17ed3b128f7048c2b8a4
7
+ data.tar.gz: 3dc3f082c6f2f3b4a30f0063a93a6740387037c638582ad9316e1817d20638a351a481d010c9c1fad07d6eed969ea08ac14380b9c9ae496bb684697f3687a677
@@ -1,6 +1,7 @@
1
- /*! autumn - v0.0.2 - 2014-07-03
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
- container: "map",
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 &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
- },
18
- map,
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(map);
38
+ L.marker(latLng).addTo(this._map);
39
39
  },
40
40
  deleteMarkers: function(layerToRemove){
41
41
  if (layerToRemove){
42
- map.removeLayer(layerToRemove);
42
+ this._map.removeLayer(layerToRemove);
43
43
  }
44
44
  else{
45
- map.removeLayer(layer);
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(map);
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(map);
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
- map.fitBounds(layer.getBounds(), {maxZoom: 18});
96
+ a._map.fitBounds(a.layer.getBounds(), {maxZoom: 16});
97
97
  return this;
98
98
  }
99
99
 
@@ -1,3 +1,3 @@
1
1
  module AutumnRails
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
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.2
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-03 00:00:00.000000000 Z
11
+ date: 2014-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler