easy_map_tiles 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy_map_tiles.rb +2 -2
- data/lib/easy_map_tiles/version.rb +1 -1
- data/spec/lib/easy_map_tiles_spec.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 829d673817a08e63a80b65e368065f6046560008
|
4
|
+
data.tar.gz: ce0c7949cb92224e915aac3117894daccda6815f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 607675f9e1b9061435377e0acaa32c50a87e68da055536156be1b2180f6494d5181b0288149b9d4188a3396666620939d6bbfd347e077441a87dcd89dfbe397b
|
7
|
+
data.tar.gz: bffdc989daaf146b6c3d0c35a521be7e3d8d259577cb23d557ada6f0ed5cd9a34312c73fafc7ba78fddf693516fe574de3c4e21d7764c2a4c0a0df9f5cee9310
|
data/lib/easy_map_tiles.rb
CHANGED
@@ -38,7 +38,7 @@ module EasyMapTiles
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
def tile_div(lat_deg, lon_deg, zoom_levels, opts={})
|
41
|
+
def tile_div(lat_deg, lon_deg, zoom_levels, opts={}, &block)
|
42
42
|
satellite = opts[:satellite] || false
|
43
43
|
marker = opts[:marker] || false
|
44
44
|
zoom = most_fitting_zoom_level(lat_deg, lon_deg, zoom_levels)
|
@@ -69,7 +69,7 @@ module EasyMapTiles
|
|
69
69
|
'width: 256px',
|
70
70
|
'height: 256px'
|
71
71
|
] unless opts[:tile_styles] == false
|
72
|
-
"<div class='emt-tile' style='#{styles.join(';')}'>#{marker_div}</div>"
|
72
|
+
"<div class='emt-tile' style='#{styles.join(';')}'>#{marker_div}#{yield if block_given?}</div>"
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -23,5 +23,12 @@ describe EasyMapTiles do
|
|
23
23
|
puts "Check resulting easy_map_tiles in test.html"
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
it 'tile_div accepts a block' do
|
27
|
+
zoom_levels = [5,6,7,8,9,10]
|
28
|
+
div = EasyMapTiles.tile_div(39.915036, 116.404996, zoom_levels, satellite: false, marker: true) do
|
29
|
+
'Block Test'
|
30
|
+
end
|
31
|
+
expect(div).to match('Block Test')
|
32
|
+
end
|
33
|
+
|
27
34
|
end
|