lib/geojson2image.rb in geojson2image-0.2.1 vs lib/geojson2image.rb in geojson2image-0.2.2
- old
+ new
@@ -203,23 +203,21 @@
if properties.key?('stroke') && !properties['stroke'].nil?
tmp_stroke = ChunkyPNG::Color.from_hex(properties['stroke'])
end
end
+ border_points = []
json['coordinates'].each do |linestrings|
- border_points = []
if linestrings[0] != linestrings[linestrings.count - 1]
linestrings << linestrings[0]
end
-
linestrings.each do |point|
new_point = transform_point(point)
border_points << "#{new_point[0]},#{new_point[1]}"
end
-
- points = ChunkyPNG::Vector.multiple_from_string(border_points.join(", "))
- @png.polygon(points, tmp_stroke, tmp_fill)
end
+ points = ChunkyPNG::Vector.multiple_from_string(border_points.join(", "))
+ @png.polygon(points, tmp_stroke, tmp_fill)
when 'MultiPolygon'
json['coordinates'].each do |polygon|
poly = {
"type" => "Polygon",