lib/terraformer/geometry.rb in terraformer-0.0.3 vs lib/terraformer/geometry.rb in terraformer-0.0.4
- old
+ new
@@ -20,14 +20,16 @@
self.coordinates = Coordinate.from_array arg['coordinates']
end
end
end
- def to_hash
- {
+ def to_hash *args
+ h = {
type: type,
coordinates: coordinates
}
+ h[:bbox] = bbox if Hash === args.last and args.last[:include_bbox]
+ h
end
def to_mercator
self.class.new *coordinates.map_coordinate(&:to_mercator)
end