Better handle empty user selection layers
This commit is contained in:
parent
4249f8ae25
commit
c8c75fc254
4 changed files with 21 additions and 4 deletions
|
@ -26,11 +26,11 @@ class Champs::CarteController < ApplicationController
|
|||
end
|
||||
|
||||
geo_areas = []
|
||||
geo_json = JSON.parse(geo_json)
|
||||
geo_json = geo_json.blank? ? [] : JSON.parse(geo_json)
|
||||
|
||||
if geo_json.first == ["error", "TooManyPolygons"]
|
||||
@error = true
|
||||
else
|
||||
elsif geo_json.present?
|
||||
if @champ.cadastres?
|
||||
cadastres = ModuleApiCartoService.generate_cadastre(geo_json)
|
||||
geo_areas += cadastres.map do |cadastre|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue