map_project 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 474548cc104238aacab99ddcbe5d8faca4d153eb
4
- data.tar.gz: dfe5978a8013cf8260eaff6033635d75c36f62ee
3
+ metadata.gz: 700d34af1c98135a8250e444bcf462d710682d9d
4
+ data.tar.gz: 64b9b61643a5133b171f5a71b093273da738504e
5
5
  SHA512:
6
- metadata.gz: 70f6a278ebb3a0935ead754f4dc1ad92322e529dac92e8b740145015a8fc7fbfb6ce4fd190bd35f75433227f497cb50e6c8e33a58f185974938d8cf82109a1ec
7
- data.tar.gz: 96e4a40bdd64c22f3acd603a397f228d70c87dbefa39c11cb2d6b7a60408580989f0800898e01a8438c1cf8cdec79bd2bf88e74a25d34934272aad7af182cd37
6
+ metadata.gz: 736c401805f720f65ac47b6dda65f5b6557a203c306055fe1da571d5ea3ec56cc541be1758a60394a20bf04f60bebf7a8e736ca9310c3ae80b8588e40bf262f5
7
+ data.tar.gz: d14e1056fde61da50422fcfafac3a16e086359dd390a17907124de059ff3e049c2668b735bd04c1bc8ce88a7bdb0bc2dc3328e4b5bcaa1f9d41d68f41a6a7520
@@ -17,12 +17,12 @@ module MapProject
17
17
  end
18
18
 
19
19
  def lat_rad(lat)
20
- sin = Math.sin(lat * Math::PI / 180)
20
+ sin = Math.sin(Rational(lat * Math::PI, 180))
21
21
  rad_x2 = Math.log((1 + sin) / (1 - sin)) / 2
22
22
  [[rad_x2, Math::PI].min, -Math::PI].max / 2
23
23
  end
24
24
 
25
25
  def zoom(map_px, world_px, fraction)
26
- (Math.log(map_px / world_px / fraction) / LN2).floor
26
+ (Math.log(Rational(map_px, world_px) / fraction) / LN2).floor
27
27
  end
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module MapProject
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.email = ["luxizou.web@gmail.com"]
12
12
  s.homepage = "https://github.com/luzou0526/map_project"
13
13
  s.summary = "Tools converting geo latlng map projection."
14
- s.description = "Gem provides a way to calculate zoom level using boudary, and project map to viewports(html elements)"
14
+ s.description = "Gem provides a way to calculate zoom level using boudary, and project map to viewports(html elements)\n0.0.3 Update: Fix rounding issue when viewport smaller than 256px"
15
15
  s.license = "MIT"
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: map_project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lu Zou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2016-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Gem provides a way to calculate zoom level using boudary, and project
14
- map to viewports(html elements)
13
+ description: |-
14
+ Gem provides a way to calculate zoom level using boudary, and project map to viewports(html elements)
15
+ 0.0.3 Update: Fix rounding issue when viewport smaller than 256px
15
16
  email:
16
17
  - luxizou.web@gmail.com
17
18
  executables: []