2016-06-09 12:08:18 +02:00
|
|
|
class Ban::SearchController < ApplicationController
|
|
|
|
def get
|
|
|
|
request = params[:request]
|
|
|
|
|
|
|
|
render json: Carto::Bano::AddressRetriever.new(request).list.inject([]) {
|
|
|
|
|acc, value| acc.push({label: value})
|
|
|
|
}.to_json
|
|
|
|
end
|
2016-06-09 16:28:44 +02:00
|
|
|
|
|
|
|
def get_address_point
|
|
|
|
point = Carto::Geocodeur.convert_adresse_to_point(params[:request])
|
|
|
|
|
2018-01-11 19:04:39 +01:00
|
|
|
if point.present?
|
2016-06-09 16:28:44 +02:00
|
|
|
lon = point.x.to_s
|
|
|
|
lat = point.y.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
render json: {lon: lon, lat: lat, zoom: '14', dossier_id: params[:dossier_id]}
|
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|