# How to use a google maps url into YM4R?

**URL:** <https://www.ruby-forum.com/t/how-to-use-a-google-maps-url-into-ym4r/87223>\
**Category:** Rails\
**Created:** [February 28, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/how-to-use-a-google-maps-url-into-ym4r/87223 "2007-02-28T23:38:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [February 28, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/how-to-use-a-google-maps-url-into-ym4r/87223/1 "2007-02-28T23:38:37Z")

</div>

hey all,  
I have a google maps url posted by the user such as:

[http://www.google.com/maps?hl=en&client=firefox-a&q=restaurants+sushi+de&near=Paris,+France&ie=UTF8&latlng=48871953,2303271,12028371856558028754&ei=lgHmRbHWDoa-2AKU78TMCA&sig2=KeqI-krw-tdRn8WR4-drEg&dtab=2&reviews=1&oi=more\_rev&sa=X](http://www.google.com/maps?hl=en&client=firefox-a&q=restaurants+sushi+de&near=Paris,+France&ie=UTF8&latlng=48871953,2303271,12028371856558028754&ei=lgHmRbHWDoa-2AKU78TMCA&sig2=KeqI-krw-tdRn8WR4-drEg&dtab=2&reviews=1&oi=more_rev&sa=X)

is there a way to get all the paramaters (such as the q, the latlngt  
and whatever is needed) of that url and use them into the ym4r  
functions?

thanx in advance

PAt

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [March 1, 2007, 8:31pm UTC](https://www.ruby-forum.com/t/how-to-use-a-google-maps-url-into-ym4r/87223/2 "2007-03-01T20:31:06Z")

</div>

Hi Patrick, how about:

google\_query = URI::parse( params[:query\_string] ).query  
google\_params = CGI::parse(google\_query)

This will give you a Hash of all the URI parameters, including the  
search string ‘q’, and ‘ll’ which is your lat-long array.

–Andrew
