topojson-rails 0.0.8 → 0.0.15

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.
@@ -1,5 +1,5 @@
1
1
  module Topojson
2
2
  module Rails
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
@@ -171,8 +171,14 @@ topojson = (function() {
171
171
  return points;
172
172
  }
173
173
 
174
+ function ring(arcs) {
175
+ var points = line(arcs);
176
+ while (points.length < 4) points.push(points[0]);
177
+ return points;
178
+ }
179
+
174
180
  function polygon(arcs) {
175
- return arcs.map(line);
181
+ return arcs.map(ring);
176
182
  }
177
183
 
178
184
  function geometry(o) {
@@ -185,7 +191,7 @@ topojson = (function() {
185
191
  Point: function(o) { return point(o.coordinates); },
186
192
  MultiPoint: function(o) { return o.coordinates.map(point); },
187
193
  LineString: function(o) { return line(o.arcs); },
188
- MultiLineString: function(o) { return polygon(o.arcs); },
194
+ MultiLineString: function(o) { return o.arcs.map(line); },
189
195
  Polygon: function(o) { return polygon(o.arcs); },
190
196
  MultiPolygon: function(o) { return o.arcs.map(polygon); }
191
197
  };
@@ -245,7 +251,7 @@ topojson = (function() {
245
251
  }
246
252
 
247
253
  return {
248
- version: "0.0.8",
254
+ version: "0.0.15",
249
255
  mesh: mesh,
250
256
  object: object,
251
257
  neighbors: neighbors
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topojson-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.15
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-01-16 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 1.8.24
72
+ rubygems_version: 1.8.23
73
73
  signing_key:
74
74
  specification_version: 3
75
75
  summary: Gemified topojson.js asset for Rails