cleanup selection_utilisateur geo_json
This commit is contained in:
parent
f51f68ec03
commit
35d2bc36fc
4 changed files with 56 additions and 19 deletions
|
@ -36,4 +36,21 @@ class GeojsonService
|
|||
|
||||
polygon.to_json
|
||||
end
|
||||
|
||||
def self.to_json_polygon_for_selection_utilisateur(coordinates)
|
||||
coordinates = coordinates.map do |lat_longs|
|
||||
outbounds = lat_longs.map do |lat_long|
|
||||
[lat_long['lng'], lat_long['lat']]
|
||||
end
|
||||
|
||||
[outbounds]
|
||||
end
|
||||
|
||||
polygon = {
|
||||
type: 'MultiPolygon',
|
||||
coordinates: coordinates
|
||||
}
|
||||
|
||||
polygon.to_json
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue