Sha256: a41ce62ea14737ecda75280ae3fefbf8a67ce29ca3d2dbfb457481e7462a0d30

Contents?: true

Size: 663 Bytes

Versions: 4

Compression:

Stored size: 663 Bytes

Contents

require 'geocoder/lookups/base'
require 'geocoder/results/cloudmade'

module Geocoder::Lookup
  class Cloudmade < Base

    def name
      "Cloudmade"
    end

    def query_url(query)
      "http://geocoding.cloudmade.com/#{configuration.api_key}/geocoding/v2/find.js?#{url_query_string(query)}"
    end

    def required_api_key_parts
      ["key"]
    end

    private

    def results(query)
      data = fetch_data(query)
      (data && data['features']) || []
    end

    def query_url_params(query)
      {
        :query => query.sanitized_text,
        :return_location => true,
        :return_geometry => false
      }.merge(super)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geocoder-1.2.3 lib/geocoder/lookups/cloudmade.rb
geocoder-1.2.2 lib/geocoder/lookups/cloudmade.rb
geocoder-1.2.1 lib/geocoder/lookups/cloudmade.rb
geocoder-1.2.0 lib/geocoder/lookups/cloudmade.rb