geocoder_here_maps 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Gemfile.lock +3 -3
- data/README.md +19 -2
- data/geocoder_here_maps.gemspec +1 -1
- data/lib/geocoder/lookups/concerns/here_lookup_default_methods.rb +7 -20
- data/lib/geocoder_here_maps/version.rb +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1fc5c1a91f69e4a4cb0779ea0d66a2f7204c0d668306e3b58b42f2dbfd4c7e79
|
4
|
+
data.tar.gz: 25cf03d9542f84e9542a8ee6c6ab7c12c75f665da1774c5fae4cdfe880f6acd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b8eab15f2f173fad56b4a58f125a55065848ce7c2e0b819956ffde0166cd688db82a9eecc6e8d0aca6b2d19c4c2dc4fc9d4bd395c62c9f284a72491af0fe3d6
|
7
|
+
data.tar.gz: 7a5fc7baa4510b40867c08f0277d16984ef97901cc1693876b5ff18fb70024d52cf9f1dc2a27f2f4f833b5c2ec7485499b066c5c4f7338bdb48a654484c9323e
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
geocoder_here_maps (0.
|
5
|
-
geocoder (
|
4
|
+
geocoder_here_maps (0.3.0)
|
5
|
+
geocoder (>= 1.5.1, < 1.7.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
diff-lcs (1.3)
|
11
|
-
geocoder (1.
|
11
|
+
geocoder (1.6.3)
|
12
12
|
rake (10.5.0)
|
13
13
|
rspec (3.8.0)
|
14
14
|
rspec-core (~> 3.8.0)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GeocoderHereMaps
|
2
2
|
|
3
|
-
An "extension" for [`geocoder`](https://github.com/alexreisner/geocoder) which adds support
|
3
|
+
An "extension" for [`geocoder`](https://github.com/alexreisner/geocoder) which adds support for using additional HERE maps APIs.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,24 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
Geocoding and reverse geocoding will work in the same way as provided by `geocoder` gem.
|
24
|
+
|
25
|
+
To use autocomplete API
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Geocoder.search('Delhi', lookup: :here_suggest)
|
29
|
+
```
|
30
|
+
|
31
|
+
To use calculateroute API
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
Geocoder.search([[26.1215649, -80.1273346], [34.8440896, -82.4057]],
|
35
|
+
lookup: :here_calculate_route,
|
36
|
+
params: { mode: 'fastest;truck', departure: "now", routeattributes: 'shape'}).first
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
If multiple lookups are used in application no need to define separate configuration for these new lookups in `geocoder.rb`. They will use the configuration defined for here maps.
|
24
41
|
|
25
42
|
## Development
|
26
43
|
|
data/geocoder_here_maps.gemspec
CHANGED
@@ -7,37 +7,24 @@ module Geocoder::Lookup
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def required_api_key_parts
|
10
|
-
["
|
10
|
+
["api_key"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def supported_protocols
|
14
|
+
[:https]
|
11
15
|
end
|
12
16
|
|
13
17
|
private
|
14
18
|
|
15
19
|
def query_url_here_options(query)
|
16
20
|
options = {
|
17
|
-
|
18
|
-
app_code: api_code,
|
21
|
+
apikey: configuration.api_key,
|
19
22
|
language: (query.language || configuration.language)
|
20
23
|
}
|
21
24
|
end
|
22
25
|
|
23
|
-
def api_key
|
24
|
-
if (a = configuration.api_key)
|
25
|
-
return a.first if a.is_a?(Array)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def api_code
|
30
|
-
if (a = configuration.api_key)
|
31
|
-
return a.last if a.is_a?(Array)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
26
|
def domain
|
36
|
-
|
37
|
-
'cit.api.here.com'
|
38
|
-
else
|
39
|
-
'api.here.com'
|
40
|
-
end
|
27
|
+
'ls.hereapi.com'
|
41
28
|
end
|
42
29
|
end
|
43
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocoder_here_maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arpit Jain
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,16 +56,22 @@ dependencies:
|
|
56
56
|
name: geocoder
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.5.1
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.7.0
|
62
65
|
type: :runtime
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
|
-
- - "
|
69
|
+
- - ">="
|
67
70
|
- !ruby/object:Gem::Version
|
68
71
|
version: 1.5.1
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.7.0
|
69
75
|
description:
|
70
76
|
email:
|
71
77
|
- arpit@bigbinary.com
|
@@ -114,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
120
|
- !ruby/object:Gem::Version
|
115
121
|
version: '0'
|
116
122
|
requirements: []
|
117
|
-
|
118
|
-
rubygems_version: 2.5.2.3
|
123
|
+
rubygems_version: 3.0.6
|
119
124
|
signing_key:
|
120
125
|
specification_version: 4
|
121
126
|
summary: Extends geocoder for HERE maps.
|