class Gmaps::Client

Included Modules

Defined in:

gmaps/client.cr

Constant Summary

Log = ::Log.for("geo_client")

Constructors

Instance Method Summary

Instance methods inherited from module Gmaps::GeoFuncs

calculate_distance(lat1 : Float64, long1 : Float64, lat2 : Float64, long2 : Float64) : Float64 calculate_distance, to_radians(degrees : Float64) : Float64 to_radians

Constructor Detail

def self.new(api_key : String) #

[View source]

Instance Method Detail

def api_key : String #

[View source]
def extract_hospitals(json_result : String) : Array(Hospital) #

[View source]
def find_nearest_hospitals(lat : Float64, long : Float64) : Array(Hospital) #

[View source]
def find_nearest_hospitals(location : Gmaps::Locatable) #

[View source]
def generate_directions_response(origin_lat : Float64, origin_long : Float64, dest_lat : Float64, dest_long : Float64) : HTTP::Client::Response #

[View source]
def generate_directions_response(origin : Gmaps::LatLon, destination : Gmaps::Hospital) : HTTP::Client::Response #

[View source]
def get_nearest_hospitals_as_json(lat : Float64, long : Float64, radius : Float64 = 50000.0) : HTTP::Client::Response #

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.56908,-116.92226&radius=5000&types=hospital&key=AIzaSyC4P-wFp5NJkICEG7gD6QpHF6Kf4IKgHko


[View source]
def http_client : HTTP::Client #

[View source]