mapkick-static 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -1
- data/lib/mapkick/static/base_map.rb +3 -1
- data/lib/mapkick/static/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d904b2e2d864f7d3bb3fdf9165b706b1b3c1f4b0448e83a68f1484cf38a88fd1
|
4
|
+
data.tar.gz: b51bffe8883486fc20814c15e7393c60052c18db2521332baea82d769e5cd5e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b7539144765466bd0fd84fe25e346f73cab2bcaf7f64b02696b7c9e297e3d17c5b9174202aea3b51c0737a59bfbd9049a5384cb38f03ca3e414f56d787c826
|
7
|
+
data.tar.gz: 46766cba3d76a8a64c1d291b6d57222a770e6ef8969f2610e595412ac7763d5291f3858a8e6c9247c90b2424c9305b0a0ff35ae382f18a0ef4c86a9cd4073157
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
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
|
|
@@ -22,12 +22,16 @@ 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
31
|
Area map (experimental)
|
30
32
|
|
33
|
+
<img src="https://chartkick.com/mapkick-static/area-map-2x?v1" alt="Area map" width="100%" height="100%">
|
34
|
+
|
31
35
|
```erb
|
32
36
|
<%= static_area_map [{geometry: {type: "Polygon", coordinates: ...}}] %>
|
33
37
|
```
|
@@ -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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mapkick-static
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -25,7 +25,7 @@ files:
|
|
25
25
|
- lib/mapkick/static/helper.rb
|
26
26
|
- lib/mapkick/static/map.rb
|
27
27
|
- lib/mapkick/static/version.rb
|
28
|
-
homepage: https://
|
28
|
+
homepage: https://github.com/ankane/mapkick-static
|
29
29
|
licenses:
|
30
30
|
- MIT
|
31
31
|
metadata: {}
|