map_project 0.0.1 → 0.0.3
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 +4 -4
- data/lib/map_project.rb +2 -2
- data/lib/map_project/version.rb +1 -1
- data/map_project.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 700d34af1c98135a8250e444bcf462d710682d9d
|
|
4
|
+
data.tar.gz: 64b9b61643a5133b171f5a71b093273da738504e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 736c401805f720f65ac47b6dda65f5b6557a203c306055fe1da571d5ea3ec56cc541be1758a60394a20bf04f60bebf7a8e736ca9310c3ae80b8588e40bf262f5
|
|
7
|
+
data.tar.gz: d14e1056fde61da50422fcfafac3a16e086359dd390a17907124de059ff3e049c2668b735bd04c1bc8ce88a7bdb0bc2dc3328e4b5bcaa1f9d41d68f41a6a7520
|
data/lib/map_project.rb
CHANGED
|
@@ -17,12 +17,12 @@ module MapProject
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def lat_rad(lat)
|
|
20
|
-
sin = Math.sin(lat * Math::PI
|
|
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
|
|
26
|
+
(Math.log(Rational(map_px, world_px) / fraction) / LN2).floor
|
|
27
27
|
end
|
|
28
28
|
end
|
data/lib/map_project/version.rb
CHANGED
data/map_project.gemspec
CHANGED
|
@@ -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.
|
|
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-
|
|
11
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
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: []
|