gogo_maps 0.0.5 → 0.2.70000000
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/gogo_maps/version.rb +2 -1
- data/lib/gogo_maps.rb +6 -2
- data/spec/gogo_maps_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e02e369a04b46ef473ad2660f77444884d7c2ca4
|
4
|
+
data.tar.gz: ee51da9063670fa3b47d1fb21ea27cfac1e765c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a784dda03805f47eaf4f17b096c56807d8fe90bb839eb6c9eca5aea16d9ca5c083a0783ec57c3f2dbadf4a5a3ca535b860cae0fb5a6550a215e95d0255bfb03f
|
7
|
+
data.tar.gz: 61aacd3eb512f3c891ee9d9b16612e93efd85534d5ab5561d5c3e6f0d59702ba6ad61280c3fbf038d43f5f9cc9d2b0e08848dd0cc68b101eadd32a246d9ba235
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Super simple geocode interface for Ruby, by using awesome GoogleMaps API
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Install gem as you like.
|
7
|
+
Install gem as you like.
|
8
8
|
|
9
9
|
$ gem install gogo_maps
|
10
10
|
|
@@ -18,10 +18,10 @@ require 'gogo_maps'
|
|
18
18
|
|
19
19
|
# Address to lat and lng.
|
20
20
|
GogoMaps.get(address: '長野県上高井郡高山村')
|
21
|
-
# => {
|
21
|
+
# => { lat: 36.6797676, lng: 138.3632554}
|
22
22
|
|
23
23
|
GogoMaps.get(address: '神奈川県横浜市港北区日吉')
|
24
|
-
# => {
|
24
|
+
# => { lat: 35.5565107, lng: 139.6460026 }
|
25
25
|
|
26
26
|
# Lat and lng to Address.
|
27
27
|
GogoMaps.get(latlng: '35.6506135,139.7539103')
|
data/lib/gogo_maps/version.rb
CHANGED
data/lib/gogo_maps.rb
CHANGED
@@ -41,8 +41,12 @@ module GogoMaps
|
|
41
41
|
end
|
42
42
|
|
43
43
|
case sym
|
44
|
-
when :to_latlng
|
45
|
-
|
44
|
+
when :to_latlng
|
45
|
+
location['geometry']['location'].each_with_object({}) do | (k, v), rslt |
|
46
|
+
rslt[k.to_s.to_sym] = v
|
47
|
+
end
|
48
|
+
when :to_address
|
49
|
+
location['formatted_address']
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
data/spec/gogo_maps_spec.rb
CHANGED
@@ -16,17 +16,17 @@ describe GogoMaps do
|
|
16
16
|
expect(
|
17
17
|
GogoMaps.get(address: '長野県上高井郡高山村')
|
18
18
|
).to eq(
|
19
|
-
{
|
19
|
+
{ lat: 36.6797676, lng: 138.3632554 }
|
20
20
|
)
|
21
21
|
expect(
|
22
22
|
GogoMaps.get(address: '神奈川県横浜市港北区日吉')
|
23
23
|
).to eq(
|
24
|
-
{
|
24
|
+
{ lat: 35.5565107, lng: 139.6460026 }
|
25
25
|
)
|
26
26
|
expect(
|
27
27
|
GogoMaps.get(address: '902 Rockefeller Dr, Sunnyvale, CA', language: :en)
|
28
28
|
).to eq(
|
29
|
-
{
|
29
|
+
{ lat: 37.358126, lng: -122.050636 }
|
30
30
|
)
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gogo_maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.70000000
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gogotanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|