mapkick-static 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +9 -1
- data/LICENSE.txt +1 -1
- data/README.md +7 -3
- data/lib/mapkick/static/base_map.rb +3 -1
- data/lib/mapkick/static/version.rb +1 -1
- metadata +5 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f543f49e14b9f40691eb152dc7fb36d7bcd82b4e78af029a55278816f454fc50
|
4
|
+
data.tar.gz: f817907cd51c57097d1c3477a6532983a1e8debce2928efb165ab0680f1ca60f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 000e1be74b9086a65721eff4f48860e74240cc862dc43bd4be7e6cbbe5c0427b5e49d4306777aa3d6ab11a2cec9ca6c69a8f1da24b31cdd068d18a5db277d026
|
7
|
+
data.tar.gz: f8574352d143f35e5c12a65e54d9c43e0dbebf4f36c31b2d94a3b0a9f40920d012675e9553cf9953bc6c996956844946d4f67252af1fc86b5e63b2900fd32d92
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Create beautiful static maps with one line of Ruby. No more fighting with mapping libraries!
|
4
4
|
|
5
|
-
[See it in action](
|
5
|
+
[See it in action](#maps)
|
6
6
|
|
7
7
|
:fire: For JavaScript maps, check out [Mapkick](https://chartkick.com/mapkick)
|
8
8
|
|
9
|
-
[](https://github.com/ankane/mapkick-static/actions)
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -22,11 +22,15 @@ Mapkick Static uses the [Mapbox Static Images API](https://docs.mapbox.com/api/m
|
|
22
22
|
|
23
23
|
Point map
|
24
24
|
|
25
|
+
<img src="https://chartkick.com/mapkick-static/map-2x?v3" alt="Point map" width="100%" height="100%">
|
26
|
+
|
25
27
|
```erb
|
26
28
|
<%= static_map [{latitude: 37.7829, longitude: -122.4190}] %>
|
27
29
|
```
|
28
30
|
|
29
|
-
Area map
|
31
|
+
Area map
|
32
|
+
|
33
|
+
<img src="https://chartkick.com/mapkick-static/area-map-2x?v1" alt="Area map" width="100%" height="100%">
|
30
34
|
|
31
35
|
```erb
|
32
36
|
<%= static_area_map [{geometry: {type: "Polygon", coordinates: ...}}] %>
|
@@ -48,7 +48,9 @@ module Mapkick
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def set_viewport(geojson)
|
51
|
-
if geojson[:features].
|
51
|
+
if geojson[:features].empty?
|
52
|
+
"0,0,0"
|
53
|
+
elsif geojson[:features].size == 1 && (geometry = geojson[:features][0][:geometry]) && geometry&.[](:type) == "MultiPoint" && geometry[:coordinates].size == 1
|
52
54
|
coordinates = geometry[:coordinates][0]
|
53
55
|
zoom = 15
|
54
56
|
"%f,%f,%d" % [round_coordinate(coordinates[0].to_f), round_coordinate(coordinates[1].to_f), zoom.to_i]
|
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mapkick-static
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email: andrew@ankane.org
|
15
13
|
executables: []
|
16
14
|
extensions: []
|
@@ -25,11 +23,10 @@ files:
|
|
25
23
|
- lib/mapkick/static/helper.rb
|
26
24
|
- lib/mapkick/static/map.rb
|
27
25
|
- lib/mapkick/static/version.rb
|
28
|
-
homepage: https://
|
26
|
+
homepage: https://github.com/ankane/mapkick-static
|
29
27
|
licenses:
|
30
28
|
- MIT
|
31
29
|
metadata: {}
|
32
|
-
post_install_message:
|
33
30
|
rdoc_options: []
|
34
31
|
require_paths:
|
35
32
|
- lib
|
@@ -37,15 +34,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
37
34
|
requirements:
|
38
35
|
- - ">="
|
39
36
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3'
|
37
|
+
version: '3.2'
|
41
38
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
39
|
requirements:
|
43
40
|
- - ">="
|
44
41
|
- !ruby/object:Gem::Version
|
45
42
|
version: '0'
|
46
43
|
requirements: []
|
47
|
-
rubygems_version: 3.
|
48
|
-
signing_key:
|
44
|
+
rubygems_version: 3.6.2
|
49
45
|
specification_version: 4
|
50
46
|
summary: Create beautiful static maps with one line of Ruby
|
51
47
|
test_files: []
|