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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a8fd5cb74990e96209e87feab8beee6b31e1d69a42f34a10a92beb03cd5e064
4
- data.tar.gz: d18aa7816d2e76a2cead6a487d443b88c3876d28f3885b578318e03d9c87332b
3
+ metadata.gz: f543f49e14b9f40691eb152dc7fb36d7bcd82b4e78af029a55278816f454fc50
4
+ data.tar.gz: f817907cd51c57097d1c3477a6532983a1e8debce2928efb165ab0680f1ca60f
5
5
  SHA512:
6
- metadata.gz: 35dd8ef3064bc945f515119fee0fa29e0f58aad2e2042a5a23e407b6fa5cc10bdc6b5c109c61196c59fd7c71cb95f5e37aabc3bfc7e49101fccdb52bddfaac8e
7
- data.tar.gz: e0e8577a9d1e7dd8cc6dc5b55e125f84aa03d5f0a61cda7068608cc807b12bfc7e2729d09d947e211558171d8c54a3567f0afeb1fac9fcd20441706c87064989
6
+ metadata.gz: 000e1be74b9086a65721eff4f48860e74240cc862dc43bd4be7e6cbbe5c0427b5e49d4306777aa3d6ab11a2cec9ca6c69a8f1da24b31cdd068d18a5db277d026
7
+ data.tar.gz: f8574352d143f35e5c12a65e54d9c43e0dbebf4f36c31b2d94a3b0a9f40920d012675e9553cf9953bc6c996956844946d4f67252af1fc86b5e63b2900fd32d92
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.2.0 (2025-04-03)
2
+
3
+ - Dropped support for Ruby < 3.2
4
+
5
+ ## 0.1.1 (2023-05-03)
6
+
7
+ - Fixed error with empty maps
8
+
1
9
  ## 0.1.0 (2023-04-26)
2
10
 
3
- - First commit
11
+ - First release
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Andrew Kane
3
+ Copyright (c) 2023-2025 Andrew Kane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
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](https://chartkick.com/mapkick-static)
5
+ [See it in action](#maps)
6
6
 
7
7
  :fire: For JavaScript maps, check out [Mapkick](https://chartkick.com/mapkick)
8
8
 
9
- [![Build Status](https://github.com/ankane/mapkick-static/workflows/build/badge.svg?branch=master)](https://github.com/ankane/mapkick-static/actions)
9
+ [![Build Status](https://github.com/ankane/mapkick-static/actions/workflows/build.yml/badge.svg)](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 (experimental)
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].size == 1 && (geometry = geojson[:features][0][:geometry]) && geometry&.[](:type) == "MultiPoint" && geometry[:coordinates].size == 1
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]
@@ -1,5 +1,5 @@
1
1
  module Mapkick
2
2
  module Static
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.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: 2023-04-26 00:00:00.000000000 Z
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://chartkick.com/mapkick-static
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.4.10
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: []