app/services/geo_query.rb
# Currently supports Google & LocationIQ Results
Currently supports Google & LocationIQ Results
Currently supports Google & LocationIQ Results
def process_results
    return false if @result.blank?
    @region = @result.state
    @city = @result.city
    @longitude = @result.longitude
    @latitude = @result.latitude
    case Geocoder.config.lookup
      when :location_iq
        @city = location_iq_city if @city.blank?
        @locality = @result.village
        @formatted_address = @result.address
        @district = @result.county
      when :google, :google_premier, :google_places_details, :google_places_search
        @locality = result_component(:sublocality)
        @formatted_address = @result.formatted_address
        @district = @result.sub_state
      else
        @district = nil
        @locality = nil
        @formatted_address = nil
    end
  end
def process_results return false if @result . blank? @region = @result . state @city = @result . city @longitude = @result . longitude @latitude = @result . latitude case Geocoder . config . lookup when :location_iq @city = location_iq_city if @city . blank? @locality = @result . village @formatted_address = @result . address @district = @result . county when :google , :google_premier , :google_places_details , :google_places_search @locality = result_component ( :sublocality ) @formatted_address = @result . formatted_address @district = @result . sub_state else @district = nil @locality = nil @formatted_address = nil end end
Currently supports Google & LocationIQ Results
Currently supports Google & LocationIQ Results