Module: Coordconver::Geo::Gaode

Extended by:
Gaode
Included in:
Gaode
Defined in:
lib/coordconver/geo/gaode.rb

Instance Method Summary collapse

Instance Method Details

#geo(address) ⇒ Object

Coordconver::Gaode.geo(“北京市朝阳区阜通东大街6号”) 116.480881,39.989410–>北京市朝阳区阜通东大街6号



20
21
22
23
24
25
26
27
28
29
# File 'lib/coordconver/geo/gaode.rb', line 20

def geo(address)
  url = geo_url

  params = {
    key: gaode_map_key,
    address: address
  }

  Utils::Request.get(url, params: params)
end

#regeo(lng, lat) ⇒ Object

Coordconver::Gaode.regeo(116.480881,39.989410) 116.480881,39.989410–>北京市朝阳区阜通东大街6号



8
9
10
11
12
13
14
15
16
# File 'lib/coordconver/geo/gaode.rb', line 8

def regeo(lng, lat)
  url = regeo_url(lng, lat)
  # params = {
  #   key: gaode_map_key,
  #   location: lng + "," + lat
  # }

  Utils::Request.get(url, params: nil)
end