Changelog (Click Version To View/Download)
- Version 0.005
- Addition: thumb_height, thumb_width, thumb_style, thumb_type, thumb_url to route rval when available (per turn)
- Version 0.004
- Addition: apistatus to geocode rval
- Addition: geocode status to geocode rval
- Addition: geocode quality to geocode rval
- Documentation: Added commas to geocoding example… oops
- Version 0.003
- bugfix: added apikey to overviewmap
- bugfix: distance is now a float value
- change: overview metrics renamed from maneuver_foo to maneuvers_foo
- Addition: [:debugurl] for manual inspection of values returned from mapquest’s api
- Version 0.002
- Addition: Routing Support
- Version 0.001
- Initial Release
Warranty: None, at all, whatsoever, use at your own risk, may burn down your house and knock over your garbage cans and return the car with the gas level on “E” and refuse to return your lawnmower even though it’s now 7 months later and you’re growing a small rainforest out back… might fall asleep while watching your children, forget to pay the electric bill, and run up massive credit card debt. In other words. You’re on your own. Dont come crying to me!
To use this client you have to first apply for a mapquest openapi key here Then you must add “*” as a referrer under “my account” for your openapi ke
Example usage:
mq = Mapquest.new(“foobazbazbooblah”)
#Geocoding
myLocation = {
:address => “555 17th Street, Suite 1600”,
:city => “Denver”,
:state => “Colorado”,
:zip => 80202,
}
puts mq.geocode(myLocation).inspect#Routing
route_request = {
:addressOrigin => {
:name => “Yahoo!”,
:address => “701 First Avenue”,
:city => “Sunnyvale”,
:stateProvince => “ca”,
},
:addressDestination => {
:name => “Google”,
:address => “1600 Amphitheatre Parkway”,
:city => ” Mountain View”,
:stateProvince => “ca”,
},
}
puts mq.route(route_request).inspect
As simple as it gets, no? Cheers!
Awesome! I was just thinking about writing a gem to do this and came across your code. I'm wicked excited that you support routing. How about adding support for the geocode status and the geocode quality?
If I might make a suggestion…
on line 136 of your 0.003 release you have this:
url
might try >
whoops, as i said before (this time with proper formating):
If I might make a suggestion…
on line 136 of your 0.003 release you have this:
url >> "routemaps=1"
But if instead you used routemaps=3 you'd get back a lot of turn-by-turn information, such as turn-by-turn map links, thumbnails, distance, and time.
Released two new versions today, 0.004 and 0.005 both based on John's suggestions
Hey, the latest version (5) looks like it has an extra 'end' at the bottom, can you check that out?
Indeed it did. Fixed