leaflet-rails 1.7.0 → 1.9.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 +4 -4
- data/lib/leaflet-rails/version.rb +1 -1
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/leaflet-src.js.erb +7913 -7478
- data/vendor/assets/javascripts/leaflet-src.js.map +1 -1
- data/vendor/assets/stylesheets/leaflet.css.erb +56 -38
- metadata +7 -15
- data/.github/stale.yml +0 -17
- data/.gitignore +0 -13
- data/.travis.yml +0 -26
- data/Gemfile +0 -7
- data/LICENSE +0 -24
- data/README.md +0 -126
- data/Rakefile +0 -6
- data/leaflet-rails.gemspec +0 -25
@@ -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-
|
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:
|
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:
|
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,27 @@ 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.
|
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-
|
424
|
-
|
425
|
-
|
430
|
+
.leaflet-attribution-flag {
|
431
|
+
display: inline !important;
|
432
|
+
vertical-align: baseline !important;
|
433
|
+
width: 1em;
|
434
|
+
height: 0.6669em;
|
426
435
|
}
|
427
436
|
.leaflet-left .leaflet-control-scale {
|
428
437
|
margin-left: 5px;
|
@@ -435,7 +444,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
435
444
|
border-top: none;
|
436
445
|
line-height: 1.1;
|
437
446
|
padding: 2px 5px 1px;
|
438
|
-
font-size: 11px;
|
439
447
|
white-space: nowrap;
|
440
448
|
overflow: hidden;
|
441
449
|
-moz-box-sizing: border-box;
|
@@ -478,17 +486,22 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
478
486
|
border-radius: 12px;
|
479
487
|
}
|
480
488
|
.leaflet-popup-content {
|
481
|
-
margin: 13px
|
482
|
-
line-height: 1.
|
489
|
+
margin: 13px 24px 13px 20px;
|
490
|
+
line-height: 1.3;
|
491
|
+
font-size: 13px;
|
492
|
+
font-size: 1.08333em;
|
493
|
+
min-height: 1px;
|
483
494
|
}
|
484
495
|
.leaflet-popup-content p {
|
485
|
-
margin:
|
496
|
+
margin: 17px 0;
|
497
|
+
margin: 1.3em 0;
|
486
498
|
}
|
487
499
|
.leaflet-popup-tip-container {
|
488
500
|
width: 40px;
|
489
501
|
height: 20px;
|
490
502
|
position: absolute;
|
491
503
|
left: 50%;
|
504
|
+
margin-top: -1px;
|
492
505
|
margin-left: -20px;
|
493
506
|
overflow: hidden;
|
494
507
|
pointer-events: none;
|
@@ -499,6 +512,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
499
512
|
padding: 1px;
|
500
513
|
|
501
514
|
margin: -10px auto 0;
|
515
|
+
pointer-events: auto;
|
502
516
|
|
503
517
|
-webkit-transform: rotate(45deg);
|
504
518
|
-moz-transform: rotate(45deg);
|
@@ -515,24 +529,21 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
515
529
|
position: absolute;
|
516
530
|
top: 0;
|
517
531
|
right: 0;
|
518
|
-
padding: 4px 4px 0 0;
|
519
532
|
border: none;
|
520
533
|
text-align: center;
|
521
|
-
width:
|
522
|
-
height:
|
523
|
-
font: 16px/
|
524
|
-
color: #
|
534
|
+
width: 24px;
|
535
|
+
height: 24px;
|
536
|
+
font: 16px/24px Tahoma, Verdana, sans-serif;
|
537
|
+
color: #757575;
|
525
538
|
text-decoration: none;
|
526
|
-
font-weight: bold;
|
527
539
|
background: transparent;
|
528
540
|
}
|
529
|
-
.leaflet-container a.leaflet-popup-close-button:hover
|
530
|
-
|
541
|
+
.leaflet-container a.leaflet-popup-close-button:hover,
|
542
|
+
.leaflet-container a.leaflet-popup-close-button:focus {
|
543
|
+
color: #585858;
|
531
544
|
}
|
532
545
|
.leaflet-popup-scrolled {
|
533
546
|
overflow: auto;
|
534
|
-
border-bottom: 1px solid #ddd;
|
535
|
-
border-top: 1px solid #ddd;
|
536
547
|
}
|
537
548
|
|
538
549
|
.leaflet-oldie .leaflet-popup-content-wrapper {
|
@@ -545,9 +556,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
545
556
|
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
|
546
557
|
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
|
547
558
|
}
|
548
|
-
.leaflet-oldie .leaflet-popup-tip-container {
|
549
|
-
margin-top: -1px;
|
550
|
-
}
|
551
559
|
|
552
560
|
.leaflet-oldie .leaflet-control-zoom,
|
553
561
|
.leaflet-oldie .leaflet-control-layers,
|
@@ -582,7 +590,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
582
590
|
pointer-events: none;
|
583
591
|
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
584
592
|
}
|
585
|
-
.leaflet-tooltip.leaflet-
|
593
|
+
.leaflet-tooltip.leaflet-interactive {
|
586
594
|
cursor: pointer;
|
587
595
|
pointer-events: auto;
|
588
596
|
}
|
@@ -642,3 +650,13 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
642
650
|
margin-left: -12px;
|
643
651
|
border-right-color: #fff;
|
644
652
|
}
|
653
|
+
|
654
|
+
/* Printing */
|
655
|
+
|
656
|
+
@media print {
|
657
|
+
/* Prevent printers from removing background-images of controls. */
|
658
|
+
.leaflet-control {
|
659
|
+
-webkit-print-color-adjust: exact;
|
660
|
+
print-color-adjust: exact;
|
661
|
+
}
|
662
|
+
}
|
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.
|
4
|
+
version: 1.9.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:
|
11
|
+
date: 2022-11-14 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
|
-
-
|
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.
|
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
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
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
|
-
[](https://travis-ci.org/axyjo/leaflet-rails)
|
2
|
-
[](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
data/leaflet-rails.gemspec
DELETED
@@ -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
|