mapbaidu 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. data/lib/map_baidu.rb +13 -7
  2. metadata +3 -4
data/lib/map_baidu.rb CHANGED
@@ -35,15 +35,15 @@ class MapBaiDu
35
35
 
36
36
 
37
37
  def get_lng
38
- return self.result()['result']['location']['lng']
38
+ return @result['result']['location']['lng']
39
39
  end
40
40
 
41
41
  def get_lat
42
- return self.result()['result']['location']['lat']
42
+ return @result['result']['location']['lat']
43
43
  end
44
44
 
45
45
  def get_location
46
- return self.result()['result']['location']
46
+ return @result['result']['location']
47
47
  end
48
48
 
49
49
  def round (distance)
@@ -51,7 +51,6 @@ class MapBaiDu
51
51
  current_lat = (self.get_lat.round(4)*10000).to_int
52
52
  current_lng = (self.get_lng.round(4)*10000).to_int
53
53
 
54
-
55
54
  #result_array = Array.new()
56
55
  #begin_lng = (current_lng - (distance/100).to_int).to_i
57
56
  #begin_lat = (current_lat - (distance/100).to_int).to_i
@@ -66,10 +65,7 @@ class MapBaiDu
66
65
  # end
67
66
  # i +=1
68
67
  #end
69
-
70
-
71
68
  result_array = Array.new
72
-
73
69
  radius = (distance.to_f/100).ceil
74
70
 
75
71
 
@@ -116,6 +112,16 @@ class MapBaiDu
116
112
 
117
113
 
118
114
 
115
+ def round_between (round1 ,round2)
116
+ if(round2 == round1)
117
+ return [];
118
+ end
119
+ min = [round1,round2].min
120
+ max = [round1,round2].max
121
+
122
+ return self.round(max) -self.round(min)
123
+ end
124
+
119
125
 
120
126
 
121
127
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mapbaidu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,9 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-17 00:00:00.000000000 Z
12
+ date: 2013-05-18 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: ! 'get [[lgn,lat]...[lgn,lat]] base current location use round and you
15
- can get [lgnlat..lgnlat] use round_to_i '
14
+ description: ! 'range between two round '
16
15
  email: zhangfortune527@gmail.com
17
16
  executables: []
18
17
  extensions: []