leaflet-rails 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,10 @@
49
49
  }
50
50
  /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
51
51
  /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
52
- .leaflet-container .leaflet-overlay-pane svg,
52
+ .leaflet-container .leaflet-overlay-pane svg {
53
+ max-width: none !important;
54
+ max-height: none !important;
55
+ }
53
56
  .leaflet-container .leaflet-marker-pane img,
54
57
  .leaflet-container .leaflet-shadow-pane img,
55
58
  .leaflet-container .leaflet-tile-pane img,
@@ -57,6 +60,8 @@
57
60
  .leaflet-container .leaflet-tile {
58
61
  max-width: none !important;
59
62
  max-height: none !important;
63
+ width: auto;
64
+ padding: 0;
60
65
  }
61
66
 
62
67
  .leaflet-container.leaflet-touch-zoom {
@@ -170,9 +175,6 @@
170
175
 
171
176
  /* zoom and fade animations */
172
177
 
173
- .leaflet-fade-anim .leaflet-tile {
174
- will-change: opacity;
175
- }
176
178
  .leaflet-fade-anim .leaflet-popup {
177
179
  opacity: 0;
178
180
  -webkit-transition: opacity 0.2s linear;
@@ -187,9 +189,10 @@
187
189
  -ms-transform-origin: 0 0;
188
190
  transform-origin: 0 0;
189
191
  }
190
- .leaflet-zoom-anim .leaflet-zoom-animated {
192
+ svg.leaflet-zoom-animated {
191
193
  will-change: transform;
192
- }
194
+ }
195
+
193
196
  .leaflet-zoom-anim .leaflet-zoom-animated {
194
197
  -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
195
198
  -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
@@ -255,14 +258,11 @@ svg.leaflet-image-layer.leaflet-interactive path {
255
258
 
256
259
  .leaflet-container {
257
260
  background: #ddd;
258
- outline: 0;
261
+ outline-offset: 1px;
259
262
  }
260
263
  .leaflet-container a {
261
264
  color: #0078A8;
262
265
  }
263
- .leaflet-container a.leaflet-active {
264
- outline: 2px solid orange;
265
- }
266
266
  .leaflet-zoom-box {
267
267
  border: 2px dotted #38f;
268
268
  background: rgba(255,255,255,0.5);
@@ -271,7 +271,10 @@ svg.leaflet-image-layer.leaflet-interactive path {
271
271
 
272
272
  /* general typography */
273
273
  .leaflet-container {
274
- font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
274
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
275
+ font-size: 12px;
276
+ font-size: 0.75rem;
277
+ line-height: 1.5;
275
278
  }
276
279
 
277
280
 
@@ -281,8 +284,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
281
284
  box-shadow: 0 1px 5px rgba(0,0,0,0.65);
282
285
  border-radius: 4px;
283
286
  }
284
- .leaflet-bar a,
285
- .leaflet-bar a:hover {
287
+ .leaflet-bar a {
286
288
  background-color: #fff;
287
289
  border-bottom: 1px solid #ccc;
288
290
  width: 26px;
@@ -299,7 +301,8 @@ svg.leaflet-image-layer.leaflet-interactive path {
299
301
  background-repeat: no-repeat;
300
302
  display: block;
301
303
  }
302
- .leaflet-bar a:hover {
304
+ .leaflet-bar a:hover,
305
+ .leaflet-bar a:focus {
303
306
  background-color: #f4f4f4;
304
307
  }
305
308
  .leaflet-bar a:first-child {
@@ -389,6 +392,8 @@ svg.leaflet-image-layer.leaflet-interactive path {
389
392
  }
390
393
  .leaflet-control-layers label {
391
394
  display: block;
395
+ font-size: 13px;
396
+ font-size: 1.08333em;
392
397
  }
393
398
  .leaflet-control-layers-separator {
394
399
  height: 0;
@@ -397,7 +402,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
397
402
  }
398
403
 
399
404
  /* Default icon URLs */
400
- .leaflet-default-icon-path {
405
+ .leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
401
406
  background-image: url(<%= asset_path 'marker-icon.png' %>);
402
407
  }
403
408
 
@@ -406,23 +411,24 @@ svg.leaflet-image-layer.leaflet-interactive path {
406
411
 
407
412
  .leaflet-container .leaflet-control-attribution {
408
413
  background: #fff;
409
- background: rgba(255, 255, 255, 0.7);
414
+ background: rgba(255, 255, 255, 0.8);
410
415
  margin: 0;
411
416
  }
412
417
  .leaflet-control-attribution,
413
418
  .leaflet-control-scale-line {
414
419
  padding: 0 5px;
415
420
  color: #333;
421
+ line-height: 1.4;
416
422
  }
417
423
  .leaflet-control-attribution a {
418
424
  text-decoration: none;
419
425
  }
420
- .leaflet-control-attribution a:hover {
426
+ .leaflet-control-attribution a:hover,
427
+ .leaflet-control-attribution a:focus {
421
428
  text-decoration: underline;
422
429
  }
423
- .leaflet-container .leaflet-control-attribution,
424
- .leaflet-container .leaflet-control-scale {
425
- font-size: 11px;
430
+ .leaflet-control-attribution svg {
431
+ display: inline !important;
426
432
  }
427
433
  .leaflet-left .leaflet-control-scale {
428
434
  margin-left: 5px;
@@ -435,7 +441,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
435
441
  border-top: none;
436
442
  line-height: 1.1;
437
443
  padding: 2px 5px 1px;
438
- font-size: 11px;
439
444
  white-space: nowrap;
440
445
  overflow: hidden;
441
446
  -moz-box-sizing: border-box;
@@ -478,17 +483,22 @@ svg.leaflet-image-layer.leaflet-interactive path {
478
483
  border-radius: 12px;
479
484
  }
480
485
  .leaflet-popup-content {
481
- margin: 13px 19px;
482
- line-height: 1.4;
486
+ margin: 13px 24px 13px 20px;
487
+ line-height: 1.3;
488
+ font-size: 13px;
489
+ font-size: 1.08333em;
490
+ min-height: 1px;
483
491
  }
484
492
  .leaflet-popup-content p {
485
- margin: 18px 0;
493
+ margin: 17px 0;
494
+ margin: 1.3em 0;
486
495
  }
487
496
  .leaflet-popup-tip-container {
488
497
  width: 40px;
489
498
  height: 20px;
490
499
  position: absolute;
491
500
  left: 50%;
501
+ margin-top: -1px;
492
502
  margin-left: -20px;
493
503
  overflow: hidden;
494
504
  pointer-events: none;
@@ -499,6 +509,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
499
509
  padding: 1px;
500
510
 
501
511
  margin: -10px auto 0;
512
+ pointer-events: auto;
502
513
 
503
514
  -webkit-transform: rotate(45deg);
504
515
  -moz-transform: rotate(45deg);
@@ -515,19 +526,18 @@ svg.leaflet-image-layer.leaflet-interactive path {
515
526
  position: absolute;
516
527
  top: 0;
517
528
  right: 0;
518
- padding: 4px 4px 0 0;
519
529
  border: none;
520
530
  text-align: center;
521
- width: 18px;
522
- height: 14px;
523
- font: 16px/14px Tahoma, Verdana, sans-serif;
524
- color: #c3c3c3;
531
+ width: 24px;
532
+ height: 24px;
533
+ font: 16px/24px Tahoma, Verdana, sans-serif;
534
+ color: #757575;
525
535
  text-decoration: none;
526
- font-weight: bold;
527
536
  background: transparent;
528
537
  }
529
- .leaflet-container a.leaflet-popup-close-button:hover {
530
- color: #999;
538
+ .leaflet-container a.leaflet-popup-close-button:hover,
539
+ .leaflet-container a.leaflet-popup-close-button:focus {
540
+ color: #585858;
531
541
  }
532
542
  .leaflet-popup-scrolled {
533
543
  overflow: auto;
@@ -545,9 +555,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
545
555
  -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
546
556
  filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
547
557
  }
548
- .leaflet-oldie .leaflet-popup-tip-container {
549
- margin-top: -1px;
550
- }
551
558
 
552
559
  .leaflet-oldie .leaflet-control-zoom,
553
560
  .leaflet-oldie .leaflet-control-layers,
@@ -582,7 +589,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
582
589
  pointer-events: none;
583
590
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
584
591
  }
585
- .leaflet-tooltip.leaflet-clickable {
592
+ .leaflet-tooltip.leaflet-interactive {
586
593
  cursor: pointer;
587
594
  pointer-events: auto;
588
595
  }
@@ -642,3 +649,13 @@ svg.leaflet-image-layer.leaflet-interactive path {
642
649
  margin-left: -12px;
643
650
  border-right-color: #fff;
644
651
  }
652
+
653
+ /* Printing */
654
+
655
+ @media print {
656
+ /* Prevent printers from removing background-images of controls. */
657
+ .leaflet-control {
658
+ -webkit-print-color-adjust: exact;
659
+ color-adjust: exact;
660
+ }
661
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaflet-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akshay Joshi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-06 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -55,19 +55,11 @@ dependencies:
55
55
  description: This gem provides the leaflet.js map display library for your Rails 4/5
56
56
  application.
57
57
  email:
58
- - joshi.a@gmail.com
58
+ - leaflet_rails@akshayjoshi.com
59
59
  executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".github/stale.yml"
64
- - ".gitignore"
65
- - ".travis.yml"
66
- - Gemfile
67
- - LICENSE
68
- - README.md
69
- - Rakefile
70
- - leaflet-rails.gemspec
71
63
  - lib/leaflet-rails.rb
72
64
  - lib/leaflet-rails/version.rb
73
65
  - lib/leaflet-rails/view_helpers.rb
@@ -86,7 +78,7 @@ homepage: ''
86
78
  licenses:
87
79
  - BSD
88
80
  metadata: {}
89
- post_install_message:
81
+ post_install_message:
90
82
  rdoc_options: []
91
83
  require_paths:
92
84
  - lib
@@ -101,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
93
  - !ruby/object:Gem::Version
102
94
  version: '0'
103
95
  requirements: []
104
- rubygems_version: 3.1.2
105
- signing_key:
96
+ rubygems_version: 3.1.6
97
+ signing_key:
106
98
  specification_version: 4
107
99
  summary: Use leaflet.js with Rails 4/5.
108
100
  test_files:
data/.github/stale.yml DELETED
@@ -1,17 +0,0 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 60
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
5
- # Issues with these labels will never be considered stale
6
- exemptLabels:
7
- - pinned
8
- - security
9
- # Label to use when marking an issue as stale
10
- staleLabel: wontfix
11
- # Comment to post when marking an issue as stale. Set to `false` to disable
12
- markComment: >
13
- This issue has been automatically marked as stale because it has not had
14
- recent activity. It will be closed if no further activity occurs. Thank you
15
- for your contributions.
16
- # Comment to post when closing a stale issue. Set to `false` to disable
17
- closeComment: false
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
-
6
- /.rspec
7
- /coverage/
8
- /log/
9
- .idea/*
10
- .ruby-gemset
11
- .ruby-version
12
- .DS_Store
13
-
data/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- matrix:
5
- include:
6
- - rvm: 2.3.0
7
- gemfile: Gemfile
8
- - rvm: 2.4.0
9
- gemfile: Gemfile
10
- - rvm: 2.5.0
11
- gemfile: Gemfile
12
- - rvm: 2.6.0
13
- gemfile: Gemfile
14
- - rvm: ruby-head
15
- gemfile: Gemfile
16
- - rvm: jruby-head
17
- gemfile: Gemfile
18
- allow_failures:
19
- - rvm: ruby-head
20
- - rvm: jruby-head
21
- before_install:
22
- - gem update --system
23
- - gem install bundler
24
- - gem --version
25
- notifications:
26
- email: false
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- #ruby=1.9.3-p374
4
- #ruby-gemset=leaflet-rails
5
-
6
- # Specify your gem's dependencies in leaflet-rails.gemspec
7
- gemspec
data/LICENSE DELETED
@@ -1,24 +0,0 @@
1
- Copyright (c) 2010-2013, Vladimir Agafonkin
2
- Copyright (c) 2010-2011, CloudMade
3
- Copyright (c) 2012-2013, Akshay Joshi
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without modification, are
7
- permitted provided that the following conditions are met:
8
-
9
- 1. Redistributions of source code must retain the above copyright notice, this list of
10
- conditions and the following disclaimer.
11
-
12
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
13
- of conditions and the following disclaimer in the documentation and/or other materials
14
- provided with the distribution.
15
-
16
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
17
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19
- COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
23
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md DELETED
@@ -1,126 +0,0 @@
1
- [![Build Status](https://travis-ci.org/axyjo/leaflet-rails.png?branch=master)](https://travis-ci.org/axyjo/leaflet-rails)
2
- [![Gem Version](https://badge.fury.io/rb/leaflet-rails.png)](http://badge.fury.io/rb/leaflet-rails)
3
-
4
- Quickstart Guide
5
- ================
6
-
7
- To start using the leaflet-rails gem, follow the steps below (assuming you use the default asset pipeline):
8
-
9
- First, add the following code to your `Gemfile`.
10
-
11
- ```ruby
12
- gem 'leaflet-rails'
13
- ```
14
-
15
- Then, run `bundle install` from within your project to download the necessary files. Following that, open your application-wide CSS file (`app/assets/stylesheets/application.css`) and add the following line as a comment:
16
-
17
- ```
18
- = require leaflet
19
- ```
20
-
21
- After that, open your application-wide Javascript file (typically `app/assets/javascripts/application.js`) and add the following line before requiring files which depend on Leaflet:
22
-
23
- ```
24
- = require leaflet
25
- ```
26
-
27
- At this point, you may skip the first two steps of the [Leaflet Quick Start guide](http://leafletjs.com/examples/quick-start/) and start at the third step (adding the map `div` to a view).
28
-
29
-
30
- Version Parity
31
- ==============
32
-
33
- `leaflet-rails` keeps version parity with the upstream `leaflet.js` library. Before v0.7.7 the versions were not always in sync, as noted in the table below.
34
-
35
- | leaflet-rails | leaflet.js | Reason |
36
- | ------------- | ------------- | ------|
37
- | 0.7.4 | 0.7.3 | Requested in #33 because of large gap between master and rubygems.org.|
38
- | 0.7.5 | 0.7.5 | leaflet.js 0.7.4 was reverted. |
39
- | 0.7.6 | ---- | Skipped to sync with upstream. |
40
- | 0.7.7 | 0.7.7 | Sync version numbers with upstream. |
41
-
42
-
43
- Helpers
44
- =======
45
-
46
- To get you up and running quickly, you can also use the gem's helper. To get started, add the following lines to a file called `leaflet.rb` in `config/initializers`:
47
-
48
- ```ruby
49
- Leaflet.tile_layer = "http://{s}.tile.cloudmade.com/YOUR-CLOUDMADE-API-KEY/997/256/{z}/{x}/{y}.png"
50
- # You can also use any other tile layer here if you don't want to use Cloudmade - see http://leafletjs.com/reference.html#tilelayer for more
51
- Leaflet.attribution = "Your attribution statement"
52
- Leaflet.max_zoom = 18
53
- ```
54
-
55
- If you are using a tile layer which requires non-default subdomains such as [MapQuest-OSM Tiles](http://developer.mapquest.com/web/products/open/map), you can set the subdomains like this:
56
-
57
- ```ruby
58
- Leaflet.tile_layer = "http://{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png"
59
- Leaflet.subdomains = ['otile1', 'otile2', 'otile3', 'otile4']
60
- ```
61
-
62
- You will then be able to call the ```#map``` helper method in a view, and make sure that the helper method is inside an erb tag like so:
63
- ```ruby
64
- <%= map(:center => {
65
- :latlng => [51.52238797921441, -0.08366235665359283],
66
- :zoom => 18
67
- }) %>
68
- ```
69
-
70
- You can also add any number of markers like so:
71
- ```ruby
72
- map(:center => {
73
- :latlng => [51.52238797921441, -0.08366235665359283],
74
- :zoom => 18
75
- },
76
- :markers => [
77
- {
78
- :latlng => [51.52238797921441, -0.08366235665359283],
79
- }
80
- ]
81
- )
82
- ```
83
-
84
- Adding a `:popup` element to a marker hash will also generate a popup for a maker:
85
-
86
- ```ruby
87
- map(:center => {
88
- :latlng => [51.52238797921441, -0.08366235665359283],
89
- :zoom => 18
90
- },
91
- :markers => [
92
- {
93
- :latlng => [51.52238797921441, -0.08366235665359283],
94
- :popup => "Hello!"
95
- }
96
- ]
97
- )
98
- ```
99
-
100
- If you want to override the map settings you have set in the initializer, you can also add them to the helper method:
101
-
102
- ```ruby
103
- map(:center => {
104
- :latlng => [51.52238797921441, -0.08366235665359283],
105
- :zoom => 18
106
- },
107
- :tile_layer => "http://{s}.somedomain.com/somepath/{z}/{x}/{y}.png",
108
- :attribution => "Some other attribution text",
109
- :max_zoom => 4
110
- )
111
- ```
112
-
113
- If you want to have multiple maps on same page , you should add unique container_id in helper method for each map:
114
-
115
- ```ruby
116
- map(:container_id => "first_map", :center => {
117
- :latlng => [51.52238797921441, -0.08366235665359283],
118
- :zoom => 18
119
- })
120
-
121
- map(:container_id => "second_map", :center => {
122
- :latlng => [51.52238797921441, -0.08366235665359283],
123
- :zoom => 18
124
- })
125
- ```
126
-
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- require 'rspec/core/rake_task'
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,25 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "leaflet-rails/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "leaflet-rails"
7
- s.version = Leaflet::Rails::VERSION
8
- s.authors = ["Akshay Joshi"]
9
- s.email = ["joshi.a@gmail.com"]
10
- s.license = "BSD"
11
- s.homepage = ""
12
- s.summary = %q{Use leaflet.js with Rails 4/5.}
13
- s.description = %q{This gem provides the leaflet.js map display library for your Rails 4/5 application.}
14
-
15
- s.rubyforge_project = "leaflet-rails"
16
-
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- s.require_paths = ["lib"]
21
-
22
- s.add_dependency "rails", '>= 4.2.0'
23
- s.add_development_dependency "rspec", '<= 3.4.0'
24
- s.add_development_dependency "simplecov-rcov"
25
- end