mapkick-rb 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7678cfa0645e5386090c2ce73f06ffca32e0cbe3d3643b23d241ac80036d8c9d
4
- data.tar.gz: 348c96a8b02cc983dda7fcc4a655bd2bb276d20b210290d6cce424b669449eac
3
+ metadata.gz: 142c0d5f613b1bf31098593e360bcef22fc2f67f8bec3df00eae695ffc38374a
4
+ data.tar.gz: 5f9411788846f23203395f615448736c12712f4d71b0069306c0b053731e4ba7
5
5
  SHA512:
6
- metadata.gz: 466776e05996b2a6cd0144c7f68e627696b6bbf85742f700ceab060a347a444a8152aa2b8fe6f30d4f0ca677985e5cbc93b7ea80c9c736500ab6e609ae620f04
7
- data.tar.gz: 68f2cf1f40bdd1242a2b91ade1bfce042bf2a234c23a64ec87b9989bf6708adcbe822d11e2c477714f989ec151b15358ac082773593f0ad400730c169d12b7a2
6
+ metadata.gz: 3b40922653a27f565fa349d4d1687d04b2add2aacf26bcab042f6ef9a87168940e3dafe7cf39e058f93b430391fbdb484779b3fce8eec3ae4d43678d97b5fa30
7
+ data.tar.gz: 17a189a1a596dfa60889ba6c8c2595faeebdeeecc4235d74adc3ebba3c8a774fcbd1347b7ce0d5c579ebb7dc363a8186a0d3763eaf2f83be3fd0ce2dd7ff9a2b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1 (2023-01-24)
2
+
3
+ - Updated Mapkick.js to 0.2.2
4
+
1
5
  ## 0.1.0 (2023-01-19)
2
6
 
3
7
  - First release
data/README.md CHANGED
@@ -82,7 +82,7 @@ In `app/assets/javascripts/application.js`, add:
82
82
  Create a map
83
83
 
84
84
  ```erb
85
- <%= js_map [{latitude: 1.23, longitude: 4.56}] %>
85
+ <%= js_map [{latitude: 37.7829, longitude: -122.4190}] %>
86
86
  ```
87
87
 
88
88
  ## Data
@@ -90,7 +90,7 @@ Create a map
90
90
  Data can be an array
91
91
 
92
92
  ```erb
93
- <%= js_map [{latitude: 1.23, longitude: 4.56}] %>
93
+ <%= js_map [{latitude: 37.7829, longitude: -122.4190}] %>
94
94
  ```
95
95
 
96
96
  Or a URL that returns JSON (same format as above)
@@ -160,7 +160,7 @@ Mapkick.options[:height] = "400px"
160
160
 
161
161
  ## Sinatra and Padrino
162
162
 
163
- Download [mapkick.bundle.js](https://raw.githubusercontent.com/ankane/mapkick/master/vendor/assets/javascripts/mapkick.js) and include it manually.
163
+ Download [mapkick.bundle.js](https://raw.githubusercontent.com/ankane/mapkick/master/vendor/assets/javascripts/mapkick.bundle.js) and include it manually.
164
164
 
165
165
  ```html
166
166
  <script src="mapkick.bundle.js"></script>
@@ -1,3 +1,3 @@
1
1
  module Mapkick
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  ================================================================================
2
- Mapkick.js 0.2.1
2
+ Mapkick.js 0.2.2
3
3
  ================================================================================
4
4
 
5
5
  Copyright (c) 2017-2023 Andrew Kane
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * This bundle includes:
3
3
  *
4
- * Mapkick.js v0.2.1
4
+ * Mapkick.js v0.2.2
5
5
  * https://github.com/ankane/mapkick.js
6
6
  * MIT License
7
7
  *
@@ -262,7 +262,7 @@
262
262
 
263
263
  function createMarkerImage(library, color) {
264
264
  // set height to center vertically
265
- var height = 71;
265
+ var height = 41;
266
266
  var width = 27;
267
267
  var scale = 2;
268
268
 
@@ -450,6 +450,8 @@
450
450
  properties.icon = options.defaultIcon || "mapkick";
451
451
  }
452
452
  properties.mapkickIconSize = properties.icon === "mapkick" ? 0.5 : 1;
453
+ properties.mapkickIconAnchor = properties.icon === "mapkick" ? "bottom" : "center";
454
+ properties.mapkickIconOffset = properties.icon === "mapkick" ? [0, 10] : [0, 0];
453
455
 
454
456
  geojson.features.push({
455
457
  type: "Feature",
@@ -515,6 +517,22 @@
515
517
 
516
518
  // use a symbol layer for markers for performance
517
519
  // https://docs.mapbox.com/help/getting-started/add-markers/#approach-1-adding-markers-inside-a-map
520
+ // use separate layers to prevent labels from overlapping markers
521
+ map.addLayer({
522
+ id: (name + "-text"),
523
+ source: name,
524
+ type: "symbol",
525
+ layout: {
526
+ "text-field": "{label}",
527
+ "text-size": 11,
528
+ "text-anchor": "top",
529
+ "text-offset": [0, 1]
530
+ },
531
+ paint: {
532
+ "text-halo-color": "rgba(255, 255, 255, 1)",
533
+ "text-halo-width": 1
534
+ }
535
+ });
518
536
  map.addLayer({
519
537
  id: name,
520
538
  source: name,
@@ -523,11 +541,8 @@
523
541
  "icon-image": "{icon}-15",
524
542
  "icon-allow-overlap": true,
525
543
  "icon-size": {type: "identity", property: "mapkickIconSize"},
526
- "text-field": "{label}",
527
- "text-size": 11,
528
- "text-anchor": "top",
529
- "text-offset": [0, 1],
530
- "text-allow-overlap": true
544
+ "icon-anchor": {type: "identity", property: "mapkickIconAnchor"},
545
+ "icon-offset": {type: "identity", property: "mapkickIconOffset"}
531
546
  }
532
547
  });
533
548
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mapkick-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
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-01-20 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org