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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f4173b1a98c99cdd8267461b4f34fa328e493e4
4
- data.tar.gz: d034d5dfbb25f7f39533efc1631d62efcb3d9233
3
+ metadata.gz: 829d673817a08e63a80b65e368065f6046560008
4
+ data.tar.gz: ce0c7949cb92224e915aac3117894daccda6815f
5
5
  SHA512:
6
- metadata.gz: def4a9258b02d483a57cea75b8894e4b5c8d17595d6a1613faee99fd846ac7e50a7e171ca53356c8c5f248c32bafa5cb71546c3df1679968cbe790d579bffb16
7
- data.tar.gz: 5c815f2e02aef8575dad404e9f77a605914f4e2e099d9265a0f6311cd0a85488dcf4dcabfcd113f34066c5acf78672b0a386629171b9b644a81c8027da8f06ce
6
+ metadata.gz: 607675f9e1b9061435377e0acaa32c50a87e68da055536156be1b2180f6494d5181b0288149b9d4188a3396666620939d6bbfd347e077441a87dcd89dfbe397b
7
+ data.tar.gz: bffdc989daaf146b6c3d0c35a521be7e3d8d259577cb23d557ada6f0ed5cd9a34312c73fafc7ba78fddf693516fe574de3c4e21d7764c2a4c0a0df9f5cee9310
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EasyMapTiles
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  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
- # TODO: way more tests, including integration tests with capybara
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_map_tiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - naema