mapkick-rb 0.1.0 → 0.1.1
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 +4 -0
- data/README.md +3 -3
- data/lib/mapkick/version.rb +1 -1
- data/licenses/LICENSE-mapkick-bundle.txt +1 -1
- data/vendor/assets/javascripts/mapkick.bundle.js +22 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 142c0d5f613b1bf31098593e360bcef22fc2f67f8bec3df00eae695ffc38374a
|
4
|
+
data.tar.gz: 5f9411788846f23203395f615448736c12712f4d71b0069306c0b053731e4ba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b40922653a27f565fa349d4d1687d04b2add2aacf26bcab042f6ef9a87168940e3dafe7cf39e058f93b430391fbdb484779b3fce8eec3ae4d43678d97b5fa30
|
7
|
+
data.tar.gz: 17a189a1a596dfa60889ba6c8c2595faeebdeeecc4235d74adc3ebba3c8a774fcbd1347b7ce0d5c579ebb7dc363a8186a0d3763eaf2f83be3fd0ce2dd7ff9a2b
|
data/CHANGELOG.md
CHANGED
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:
|
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:
|
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>
|
data/lib/mapkick/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* This bundle includes:
|
3
3
|
*
|
4
|
-
* Mapkick.js v0.2.
|
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 =
|
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
|
-
"
|
527
|
-
"
|
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.
|
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-
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|