jekyll-maps 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +4 -0
- data/README.md +5 -1
- data/lib/jekyll-maps/google_map_api.js +10 -2
- data/lib/jekyll-maps/google_map_tag.rb +2 -2
- data/lib/jekyll-maps/location_finder.rb +7 -3
- data/lib/jekyll-maps/options_parser.rb +1 -0
- data/lib/jekyll-maps/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e101ef0a8a4f48f829f8921b069f6e6c510db44a
|
4
|
+
data.tar.gz: 7f7651c7b40013fbf08572742c04141c43d596c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 378f1cd5f0dde347cf711b4390bf796db37e48aaae8d37d2fae6da1f4b8eff147b85350c8c6e127998c9ab47972834900a0cc0eedb6ab1051a70e6324085229e
|
7
|
+
data.tar.gz: fbe266068425d1328478e7304db573e6b2f88027f05f5892b1aa64fbf9f7b6326512d56728e5d048a749eb9674683c761b56ddcdbacd4cf708fb1c26cc79cdd7
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -78,7 +78,7 @@ For instance, following tag will only display locations from documents which hav
|
|
78
78
|
### Marker Cluster
|
79
79
|
|
80
80
|
By default [Marker Clusterer](https://github.com/googlemaps/js-marker-clusterer) is enabled.
|
81
|
-
If you have many markers on the map, it will group them and show icon with the count of markers in each cluster - [
|
81
|
+
If you have many markers on the map, it will group them and show icon with the count of markers in each cluster - [see example](https://googlemaps.github.io/js-marker-clusterer/examples/advanced_example.html).
|
82
82
|
|
83
83
|
If you don't want to use marker cluster, you can disable it globally in `_config.yml`:
|
84
84
|
|
@@ -108,3 +108,7 @@ Want to see it in action? Check out [Demo Page](https://ayastreb.github.io/jekyl
|
|
108
108
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
109
109
|
4. Push to the branch (`git push origin my-new-feature`)
|
110
110
|
5. Create a new Pull Request
|
111
|
+
|
112
|
+
## License
|
113
|
+
|
114
|
+
[MIT](https://github.com/ayastreb/jekyll-maps/blob/master/LICENSE). Feel free to use, copy or distribute it.
|
@@ -18,7 +18,7 @@ var jekyllMaps = (function () {
|
|
18
18
|
this.options = {
|
19
19
|
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
20
20
|
center: new google.maps.LatLng(0, 0),
|
21
|
-
zoom:
|
21
|
+
zoom: 12
|
22
22
|
}
|
23
23
|
this.mapReady = true;
|
24
24
|
this.render();
|
@@ -45,10 +45,12 @@ var jekyllMaps = (function () {
|
|
45
45
|
while (this.data.length > 0) {
|
46
46
|
var data = this.data.pop(),
|
47
47
|
bounds = new google.maps.LatLngBounds(),
|
48
|
-
|
48
|
+
options = this.options,
|
49
|
+
map = new google.maps.Map(document.getElementById(data.id), options),
|
49
50
|
markers = data.locations.map(createMarker);
|
50
51
|
|
51
52
|
map.fitBounds(bounds);
|
53
|
+
google.maps.event.addListenerOnce(map, 'bounds_changed', onBoundsChanged);
|
52
54
|
if (data.useCluster) {
|
53
55
|
this.maps.push({map: map, markers: markers});
|
54
56
|
this.processCluster();
|
@@ -71,6 +73,12 @@ var jekyllMaps = (function () {
|
|
71
73
|
|
72
74
|
return marker;
|
73
75
|
}
|
76
|
+
|
77
|
+
function onBoundsChanged() {
|
78
|
+
if (this.getZoom() > options.zoom) {
|
79
|
+
this.setZoom(options.zoom);
|
80
|
+
}
|
81
|
+
}
|
74
82
|
}
|
75
83
|
|
76
84
|
function initializeCluster(settings) {
|
@@ -12,8 +12,8 @@ module Jekyll
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def render(context)
|
15
|
-
locations
|
16
|
-
use_cluster
|
15
|
+
locations = @finder.find(context.registers[:site], context.registers[:page])
|
16
|
+
use_cluster = @args[:flags][:no_cluster] ? "false" : "true"
|
17
17
|
@args[:attributes][:id] ||= SecureRandom.uuid
|
18
18
|
|
19
19
|
<<HTML
|
@@ -6,9 +6,13 @@ module Jekyll
|
|
6
6
|
@options = options
|
7
7
|
end
|
8
8
|
|
9
|
-
def find(site)
|
10
|
-
|
11
|
-
|
9
|
+
def find(site, page)
|
10
|
+
if @options[:flags][:on_page]
|
11
|
+
@documents << page if location?(page)
|
12
|
+
else
|
13
|
+
site.collections.each { |_, collection| filter(collection.docs) }
|
14
|
+
site.data.each { |_, docs| filter(docs) }
|
15
|
+
end
|
12
16
|
|
13
17
|
@documents.map do |document|
|
14
18
|
{
|
data/lib/jekyll-maps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoliy Yastreb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|