Class: Tasks::Gis::DrawMapItemController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/gis/draw_map_item_controller.rb

Instance Method Summary (collapse)

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

- (Object) collect_item



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/tasks/gis/draw_map_item_controller.rb', line 18

def collect_item

  geographic_areas = GeographicArea.find_by_lat_long(
      params['latitude'].to_f,
      params['longitude'].to_f
  )
  @feature_collection     = ::Gis::GeoJSON.feature_collection(geographic_areas)

  # @asserted_distributions = AssertedDistribution.stub_new(collection_params(params).merge('geographic_areas' => geographic_areas))

  # render json: {
  #            html:               render_to_string(partial:    'asserted_distributions/quick_new_asserted_distribution_form',
  #                                                 collection: @asserted_distributions,
  #                                                 as:         :asserted_distribution,
  #                                                 locals:     {token: form_authenticity_token}),
  #            feature_collection: @feature_collection,
  #        }
end

- (Object) create_map_item



15
16
# File 'app/controllers/tasks/gis/draw_map_item_controller.rb', line 15

def create_map_item
end

- (Object) new_map_item



6
7
8
9
10
11
12
13
# File 'app/controllers/tasks/gis/draw_map_item_controller.rb', line 6

def new_map_item
  # @asserted_distribution = AssertedDistributions.new(asserted_distribution_params)
  # @otu                = Otu.find(params[:asserted_distribution][:otu_id])
  # todo: this needs to be tested and accounted for in maps.js
  @feature_collection = ::Gis::GeoJSON.feature_collection([])
  # source_id           = params[:asserted_distribution][:source_id]
  # @source             = Source.find(source_id) unless source_id.blank?
end