blacklight-maps 0.1.0 → 0.1.1

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: f5cede804f84631bbe7ec2c80370c8f0cbf88c31
4
- data.tar.gz: 853cd08e29850b439c5d7773c48118b835216d28
3
+ metadata.gz: c65861d83b3dd09bf952bdb38a75daba0df6c3a2
4
+ data.tar.gz: 6590ed2323e163921cd0c31a4529c44e9290bf74
5
5
  SHA512:
6
- metadata.gz: 4181770fa39430c201156ab3b9d83cffc0208a58c530e6209fea4d5f4ce56b3e52d04ee7a49059be6cd84ae65208589afdc00f6e80de51a082652b1f8d33cb9e
7
- data.tar.gz: defd9c711b0f083449e952726548532d078b639c822fc606ab4fd3d79f3eaf3abeb5658a022a52041dca3981a2363eecfbb284dcaaa37f534e89d27b5057a0d7
6
+ metadata.gz: 450803322d3af9937d7dd1806cec17d8fa3894b63a0878221e46ece78036eef3d8731d0a14fb7e35694ead8b4451eff229b2fb60672c71f90a05e8fc7c94c843
7
+ data.tar.gz: 366c568585f5b81baad7f35a6e142aa160a3054c78382993e002db9922b1e41cef75d8bef9724db980d0f872dce28952a2e55eed56b5d1c54ee3fdaf2f51a251
data/Gemfile CHANGED
@@ -3,19 +3,21 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in blacklight-maps.gemspec
4
4
  gemspec
5
5
 
6
- gem 'simplecov', require: false
7
- gem 'coveralls', require: false
8
-
9
6
  # If we don't specify 2.11.0 we'll end up with sprockets 2.12.0 in the main
10
7
  # Gemfile.lock but since sass-rails gets generated (rails new) into the test app
11
8
  # it'll want sprockets 2.11.0 and we'll have a conflict
12
9
  gem 'sprockets', '2.11.0'
13
10
 
14
- # # If we don't specify 3.2.15 we'll end up with sass 3.3.2 in the main
15
- # # Gemfile.lock but since sass-rails gets generated (rails new) into the test app
16
- # # it'll want sass 3.2.0 and we'll have a conflict
11
+ # If we don't specify 3.2.15 we'll end up with sass 3.3.2 in the main
12
+ # Gemfile.lock but since sass-rails gets generated (rails new) into the test app
13
+ # it'll want sass 3.2.0 and we'll have a conflict
17
14
  gem 'sass', '~> 3.2.0'
15
+ gem 'bootstrap-sass', ">= 3.1.1.1"
18
16
 
17
+ group :test do
18
+ gem 'simplecov', require: false
19
+ gem 'coveralls', require: false
20
+ end
19
21
 
20
22
  file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
21
23
  if File.exists?(file)
data/README.md CHANGED
@@ -20,6 +20,10 @@ And then execute:
20
20
  Or install it yourself as:
21
21
 
22
22
  $ gem install blacklight-maps
23
+
24
+ Run Blacklight-Maps generator:
25
+
26
+ $ rails g blacklight_maps:install
23
27
 
24
28
  ## Usage
25
29
 
@@ -3,6 +3,9 @@
3
3
  $.fn.blacklight_leaflet_map = function(geojson_docs, arg_opts) {
4
4
  var map, sidebar, markers, geoJsonLayer, currentLayer;
5
5
 
6
+ // Update page links with number of mapped items
7
+ $('.page_links').append('<span class="badge mapped-count">' + geojson_docs.features.length + '</span> mapped');
8
+
6
9
  // Configure default options and those passed via the constructor options
7
10
  var options = $.extend({
8
11
  tileurl : 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
@@ -13,6 +13,11 @@
13
13
  height: 550px;
14
14
  }
15
15
 
16
+ .badge.mapped-count {
17
+ margin-left: 8px;
18
+ vertical-align: text-bottom;
19
+ }
20
+
16
21
  .sidebar-thumb{
17
22
  height: 64px;
18
23
  width: 64px;
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.5"
28
28
  spec.add_development_dependency "rake"
29
- spec.add_development_dependency "rspec-rails"
29
+ spec.add_development_dependency "rspec-rails", "~> 2.9"
30
30
  spec.add_development_dependency "jettywrapper"
31
- spec.add_development_dependency "engine_cart", "~> 0.3.2"
31
+ spec.add_development_dependency "engine_cart", "~> 0.4.0"
32
32
  spec.add_development_dependency "capybara"
33
33
  spec.add_development_dependency "poltergeist", ">= 1.5.0"
34
34
  end
@@ -22,6 +22,10 @@ module BlacklightMaps
22
22
  center = []
23
23
  center[0] = (@west + @east) / 2
24
24
  center[1] = (@south + @north) / 2
25
+
26
+ # Handle bounding boxes that cross the dateline
27
+ center[0] -= 180 if @west > @east
28
+
25
29
  center
26
30
  end
27
31
 
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Maps
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -97,6 +97,10 @@ describe "Map View", js: true do
97
97
  expect(find("div.marker-cluster")).to have_content(4)
98
98
  end
99
99
 
100
+ it "should display number mapped" do
101
+ expect(page).to have_content('4 mapped')
102
+ end
103
+
100
104
  describe "click marker cluster" do
101
105
  before { find("div.marker-cluster").click }
102
106
 
@@ -58,7 +58,7 @@ describe "BlacklightMaps::GeojsonExport" do
58
58
  end
59
59
 
60
60
  it "should render correct sidebar div" do
61
- expect(subject.send(:render_leaflet_sidebar_partial, @response.docs[0])).to include('href="/catalog/2008308478">')
61
+ expect(subject.send(:render_leaflet_sidebar_partial, @response.docs[0])).to include('href="/catalog/2008308478')
62
62
  end
63
63
 
64
64
  it "should render feature collection as json" do
@@ -4,6 +4,7 @@ describe "BlacklightMaps::Geometry::BoundingBox" do
4
4
 
5
5
  let(:bbox) { BlacklightMaps::Geometry::BoundingBox.from_lon_lat_string('-100 -50 100 50') }
6
6
  let(:bbox_california) { BlacklightMaps::Geometry::BoundingBox.from_lon_lat_string('-124.4096196 32.5342321 -114.131211 42.0095169') }
7
+ let(:bbox_dateline) {BlacklightMaps::Geometry::BoundingBox.from_lon_lat_string('165 30 -172 -20') }
7
8
 
8
9
  it "should instantiate Geometry::BoundingBox" do
9
10
  expect(bbox.class).to eq(::BlacklightMaps::Geometry::BoundingBox)
@@ -16,4 +17,8 @@ describe "BlacklightMaps::Geometry::BoundingBox" do
16
17
  it "should return center of California bounding box" do
17
18
  expect(bbox_california.find_center).to eq([-119.2704153, 37.271874499999996])
18
19
  end
20
+
21
+ it "should return correct dateline bounding box" do
22
+ expect(bbox_dateline.find_center).to eq([-183.5, 5])
23
+ end
19
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-maps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-26 00:00:00.000000000 Z
12
+ date: 2014-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -127,16 +127,16 @@ dependencies:
127
127
  name: rspec-rails
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ">="
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '0'
132
+ version: '2.9'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '0'
139
+ version: '2.9'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: jettywrapper
142
142
  requirement: !ruby/object:Gem::Requirement
@@ -157,14 +157,14 @@ dependencies:
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: 0.3.2
160
+ version: 0.4.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 0.3.2
167
+ version: 0.4.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: capybara
170
170
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  requirements: []
260
260
  rubyforge_project:
261
- rubygems_version: 2.2.0
261
+ rubygems_version: 2.2.2
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Maps for Blacklight
@@ -271,4 +271,3 @@ test_files:
271
271
  - spec/spec_helper.rb
272
272
  - spec/test_app_templates/Gemfile.extra
273
273
  - spec/test_app_templates/lib/generators/test_app_generator.rb
274
- has_rdoc: