Project

georama

0.0
No commit activity in last 3 years
No release in over 3 years
Extract information like coordinates from a google maps url
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.0
~> 1.3
 Project Readme

georama Circle CI Gem Version

A simple google maps url parser

Installation

Simply add the following line to your Gemfile:

gem 'georama'

Usage

Parsing a general maps url:

url = "https://www.google.com/maps/@-33.9218305,18.4296954,15z?hl=en"
map_url = Georama::Url.new(url)

map_url.coordinates
# => {latitude: -33.9218305, longitude: 18.4296954}

map_url.latitude
# => -33.9218305

map_url.matadata
# => {zoom: 15}

map_url.zoom
# => 15

Parsing a place url:

url = "https://www.google.com/maps/place/Cape+Town/@-33.9218305,18.4296954,15z/data=foobar"
map_url = Georama::Url.new(url)

map_url.coordinates
# => {latitude: -33.9218305, longitude: 18.4296954}

map_url.place
# => "Cape Town"

TODO:

  • Parse directions urls