geoblacklight 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -13
  2. data/.coveralls.yml +1 -0
  3. data/.gitmodules +1 -1
  4. data/.travis.yml +9 -0
  5. data/Gemfile +18 -0
  6. data/README.md +36 -38
  7. data/Rakefile +9 -9
  8. data/app/assets/fonts/geoblacklight.eot +0 -0
  9. data/app/assets/fonts/geoblacklight.svg +117 -0
  10. data/app/assets/fonts/geoblacklight.ttf +0 -0
  11. data/app/assets/fonts/geoblacklight.woff +0 -0
  12. data/app/assets/images/blacklight/logo.png +0 -0
  13. data/app/assets/javascripts/geoblacklight/application.js +1 -0
  14. data/app/assets/javascripts/geoblacklight/geoblacklight.js +86 -2
  15. data/app/assets/javascripts/geoblacklight/modules/collapse.js +6 -0
  16. data/app/assets/javascripts/geoblacklight/modules/download.js +45 -0
  17. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +77 -0
  18. data/app/assets/javascripts/geoblacklight/modules/home.js +10 -0
  19. data/app/assets/javascripts/geoblacklight/modules/item.js +72 -0
  20. data/app/assets/javascripts/geoblacklight/modules/map-view.js +7 -7
  21. data/app/assets/javascripts/geoblacklight/modules/results.js +50 -0
  22. data/app/assets/stylesheets/geoblacklight/_geoblacklight.css.scss +20 -0
  23. data/app/assets/stylesheets/geoblacklight/_styles.css.scss +44 -0
  24. data/app/assets/stylesheets/geoblacklight/application.css.scss +3 -0
  25. data/app/assets/stylesheets/geoblacklight/modules/home.css.scss +3 -0
  26. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.css.scss +10 -0
  27. data/app/assets/stylesheets/geoblacklight/modules/icons.css.scss +77 -0
  28. data/app/assets/stylesheets/geoblacklight/modules/item.css.scss +4 -0
  29. data/app/assets/stylesheets/geoblacklight/modules/results.css.scss +29 -0
  30. data/app/controllers/download_controller.rb +22 -94
  31. data/app/controllers/wms_controller.rb +2 -74
  32. data/app/helpers/geoblacklight_helper.rb +6 -36
  33. data/app/views/catalog/_document_split.html.erb +4 -0
  34. data/app/views/catalog/_home_text.html.erb +2 -39
  35. data/app/views/catalog/_index_split_default.html.erb +24 -0
  36. data/app/views/catalog/_show_default.html.erb +4 -57
  37. data/app/views/catalog/_show_header_default.html.erb +8 -0
  38. data/app/views/catalog/_show_sidebar.html.erb +17 -57
  39. data/app/views/catalog/_upper_metadata.html.erb +38 -0
  40. data/config/initializers/rails_config.rb +3 -0
  41. data/config/jetty.yml +6 -0
  42. data/config/locales/geoblacklight.en.yml +5 -0
  43. data/geoblacklight.gemspec +5 -5
  44. data/lib/generators/geoblacklight/install_generator.rb +45 -15
  45. data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +2 -78
  46. data/lib/generators/geoblacklight/templates/settings.yml +9 -0
  47. data/lib/geoblacklight.rb +13 -0
  48. data/lib/geoblacklight/controller_override.rb +18 -0
  49. data/lib/geoblacklight/download.rb +63 -0
  50. data/lib/geoblacklight/download/kmz_download.rb +14 -0
  51. data/lib/geoblacklight/download/shapefile_download.rb +14 -0
  52. data/lib/geoblacklight/engine.rb +11 -1
  53. data/lib/geoblacklight/solr_document.rb +30 -0
  54. data/lib/geoblacklight/version.rb +1 -1
  55. data/lib/geoblacklight/view_helper_override.rb +17 -0
  56. data/lib/geoblacklight/wms_layer.rb +38 -0
  57. data/lib/geoblacklight/wms_layer/feature_info_response.rb +30 -0
  58. data/lib/tasks/geoblacklight.rake +15 -0
  59. data/spec/features/download_layer_spec.rb +18 -0
  60. data/spec/features/home_page_spec.rb +49 -0
  61. data/spec/features/layer_inspection_spec.rb +9 -0
  62. data/spec/features/layer_preview_spec.rb +16 -0
  63. data/spec/features/split_view.html.erb_spec.rb +35 -0
  64. data/spec/fixtures/test-berkeley-fields.json +44 -0
  65. data/spec/lib/geoblacklight/controller_override_spec.rb +28 -0
  66. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +15 -0
  67. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +14 -0
  68. data/spec/lib/geoblacklight/download_spec.rb +76 -0
  69. data/spec/lib/geoblacklight/solr_document.rb +52 -0
  70. data/spec/lib/geoblacklight/view_helper_override_spec.rb +23 -0
  71. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +43 -0
  72. data/spec/lib/geoblacklight/wms_layer_spec.rb +33 -0
  73. data/spec/spec_helper.rb +3 -6
  74. data/spec/test_app_templates/lib/generators/test_app_generator.rb +2 -2
  75. data/spec/views/catalog/_document_split.html.erb_spec.rb +5 -0
  76. data/spec/views/catalog/_index_split.html.erb_spec.rb +5 -0
  77. data/template.rb +10 -0
  78. data/vendor/assets/javascripts/native.history.js +1 -0
  79. metadata +129 -82
  80. data/app/assets/images/geoblacklight/src_berkeley.png +0 -0
  81. data/app/assets/images/geoblacklight/src_cambridge.png +0 -0
  82. data/app/assets/images/geoblacklight/src_harvard.png +0 -0
  83. data/app/assets/images/geoblacklight/src_maryland.png +0 -0
  84. data/app/assets/images/geoblacklight/src_massgis.png +0 -0
  85. data/app/assets/images/geoblacklight/src_mit.png +0 -0
  86. data/app/assets/images/geoblacklight/src_princeton.png +0 -0
  87. data/app/assets/images/geoblacklight/src_stanford.png +0 -0
  88. data/app/assets/images/geoblacklight/src_tufts.png +0 -0
  89. data/app/assets/images/geoblacklight/src_un.png +0 -0
  90. data/app/assets/images/geoblacklight/type_arc.png +0 -0
  91. data/app/assets/images/geoblacklight/type_dot.png +0 -0
  92. data/app/assets/images/geoblacklight/type_library.png +0 -0
  93. data/app/assets/images/geoblacklight/type_map.png +0 -0
  94. data/app/assets/images/geoblacklight/type_polygon.png +0 -0
  95. data/app/assets/images/geoblacklight/type_raster.png +0 -0
  96. data/app/assets/javascripts/geoblacklight/modules/map-home.js +0 -25
  97. data/app/assets/javascripts/geoblacklight/modules/map-results.js +0 -72
  98. data/app/views/catalog/_document_list.html.erb +0 -12
  99. data/app/views/catalog/_index_header_default.html.erb +0 -59
  100. data/spec/fixtures/geoblacklight_schema/transformed.json +0 -53
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- console.log('DEBUG: Inside geoblacklight/modules/map-home.js');
4
-
5
- Blacklight.onLoad(function () {
6
- $('#geoblacklight-map-home').geoBlacklight_setupMapHome();
7
- });
8
-
9
- /* Requires leaflet */
10
- (function( $ ) {
11
-
12
- $.fn.geoBlacklight_setupMapHome = function () {
13
- console.log(this)
14
- return this.each(function () {
15
- var map = L.map('map');
16
- var basemap = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
17
- attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
18
- maxZoom: 18
19
- }).addTo(map);
20
- map.setZoom(1);
21
- map.setView([0,0]);
22
- })
23
- };
24
-
25
- })( jQuery );
@@ -1,72 +0,0 @@
1
- 'use strict';
2
- console.log('DEBUG: Inside geoblacklight/modules/map-results.js');
3
-
4
- Blacklight.onLoad(function () {
5
- $('#geoblacklight-map-results').geoBlacklight_setupMapResults();
6
- });
7
-
8
- /* Requires leaflet */
9
- (function( $ ) {
10
- var map;
11
- $.fn.geoBlacklight_setupMapResults = function () {
12
- // console.log(this)
13
- return this.each(function () {
14
- map = L.map('map');
15
- var basemap = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
16
- attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">',
17
- maxZoom: 18
18
- }).addTo(map);
19
- map.setView([0,0],1);
20
- // console.log(mapBbox);
21
- map.fitBounds(mapBbox);
22
- })
23
- };
24
-
25
- $.fn.geoBlacklight_addBbox = function (i) {
26
- i.addTo(map);
27
- };
28
-
29
- $.fn.geoBlacklight_removeBbox = function (j) {
30
- for(var i in map._layers) {
31
- if(map._layers[i]._path !== undefined && i !== 0) {
32
- try {
33
- map.removeLayer(map._layers[i]);
34
- }
35
- catch(e) {
36
- console.log("problem with " + e + map._layers[i]);
37
- }
38
- }
39
- }
40
- };
41
-
42
- $.fn.geoBlacklight_computeBbox = function (i) {
43
- var doc = solrDocs[i];
44
- //Calculates map bounding box and creates layer bbox
45
- if (doc.solr_bbox){
46
- bBoxs[i] = L.polygon([
47
- [doc.solr_sw_pt_0_d, doc.solr_sw_pt_1_d],
48
- [doc.solr_ne_pt_0_d, doc.solr_sw_pt_1_d],
49
- [doc.solr_ne_pt_0_d, doc.solr_ne_pt_1_d],
50
- [doc.solr_sw_pt_0_d, doc.solr_ne_pt_1_d]]);
51
-
52
- if (mapBbox.length == 0) {
53
- mapBbox = [[doc.solr_sw_pt_0_d, doc.solr_sw_pt_1_d],
54
- [doc.solr_ne_pt_0_d, doc.solr_ne_pt_1_d]];
55
- } else{
56
- if (doc.solr_sw_pt_0_d < mapBbox[0][0]){
57
- mapBbox[0][0] = doc.solr_sw_pt_0_d;
58
- }
59
- if (doc.solr_sw_pt_1_d < mapBbox[0][1]){
60
- mapBbox[0][1] = doc.solr_sw_pt_1_d;
61
- }
62
- if (doc.solr_ne_pt_0_d > mapBbox[1][0]){
63
- mapBbox[1][0] = doc.solr_ne_pt_0_d;
64
- }
65
- if (doc.solr_ne_pt_1_d > mapBbox[1][1]){
66
- mapBbox[1][1] = doc.solr_ne_pt_1_d;
67
- }
68
- }
69
- }
70
- }
71
-
72
- })( jQuery );
@@ -1,12 +0,0 @@
1
- <%- # container for all documents in index view -%>
2
- <%= javascript_tag "var solrDocs = #{documents.to_json};" %>
3
- <%= javascript_tag "var bBoxs = new L.LayerGroup([]);" %>
4
- <%= javascript_tag "var mapBbox = [];" %>
5
-
6
- <div id="documents" class="docView col-md-6">
7
- <%= render documents, :as => :document %>
8
- </div>
9
- <div id="geoblacklight-map-results">
10
- <div id="map" class="listview-map col-md-6">
11
- </div>
12
- </div>
@@ -1,59 +0,0 @@
1
- <% # header bar for doc items in index view -%>
2
- <div data-layer="<%= document['uuid'] %>" class="documentHeader row">
3
-
4
- <%# main title container for doc partial view
5
- How many bootstrap columns need to be reserved
6
- for bookmarks control depends on size.
7
- -%>
8
- <h5 class="index_title col-sm-9 col-lg-10 text-span">
9
- <% counter = document_counter_with_offset(document_counter) %>
10
- <span class="document-counter">
11
- <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
12
- </span>
13
- <%= link_to_document document, :label=>document_show_link_field(document), :counter => counter, :title => document['dc_title_s'] %>
14
- &nbsp;
15
- <%= layer_type_image(document['layer_geom_type_s']) %>
16
- <%= layer_institution_image(document['dct_provenance_s']) %>
17
- <%= layer_access_image(document['dc_rights_s']) %>
18
- </h5>
19
-
20
- <% # bookmark functions for items/docs -%>
21
- <!-- <%= render_index_doc_actions document, :wrapping_class => "index-document-functions col-sm-3 col-lg-2" %> -->
22
-
23
- <div class="row" data-layer="<%= document['uuid'] %>">
24
- <div class="col-md-12">
25
- <div class="" data-layer="<%= document['uuid'] %>-accordion">
26
- <div data-layer="<%= document['uuid'] %>-collapse" class="panel-collapse collapse">
27
- <div class="">
28
- <small>
29
- <ul class="list-unstyled">
30
- <li>
31
- <%= document['solr_year_i'] %>. <i><%= document['dc_creator_sm'].nil?? '' : document['dc_creator_sm'].join(', ') %></i>. <%= snippit(document['dc_description_s']) %>. <%= document['dc_publisher_s'] %>. Score: <%= document['score'] %>
32
- </li>
33
- </ul>
34
- </small>
35
- </div>
36
- <br>
37
- </div>
38
- </div>
39
- </div>
40
- </div>
41
- <script>
42
- $.fn.geoBlacklight_computeBbox(<%= document_counter %>);
43
- $("*[data-layer=\"<%= document['uuid']%>\"]").click(function(){
44
- $("*[data-layer=\"<%= document['uuid']%>-collapse\"]").collapse("toggle")
45
- });
46
-
47
- $("*[data-layer=\"<%= document['uuid']%>\"]").mouseover(function(){
48
- if (bBoxs[<%= document_counter %>]){
49
- // console.log(bBoxs[<%= document_counter %>]);
50
- $.fn.geoBlacklight_addBbox(bBoxs[<%= document_counter %>]);
51
- }
52
- });
53
-
54
- $("*[data-layer=\"<%= document['uuid']%>\"]").mouseout(function(){
55
- $.fn.geoBlacklight_removeBbox(bBoxs[<%= document_counter %>]);
56
- });
57
- </script>
58
- </div>
59
-
@@ -1,53 +0,0 @@
1
- [{
2
- "uuid": "http://purl.stanford.edu/bw938nk9584",
3
- "dc_description_s": "This polygon dataset shows post-delimitation state Legislative Assembly constituency boundaries and data relating to the 2008 Assembly elections for the State of Tripura, India. Map includes data for 60 constituencies. Includes attribute data on election parties, candidates, voters, and results. This layer is part of the Poll Map of India which includes parliamentary constituency boundaries for India, Assembly constituency boundaries for all states, and data relating to the past national elections for each State of India.; This data can be used for election analysis, forecasting, and mapping: Enables profiling of individual constituencies, permits historical analysis of the data, and helps predictive estimate of the impact of regional and state-wise electorate swings on the performance of political parties. These data are intended for researchers, students, and policy makers for reference and mapping purposes, and may be used for basic applications such as viewing, querying, and map output production.; ",
4
- "dc_format_s": "Shapefile",
5
- "dc_identifier_s": "http://purl.stanford.edu/bw938nk9584",
6
- "dc_language_s": "English",
7
- "dc_publisher_s": "ML InfoMap (Firm)",
8
- "dc_rights_s": "Restricted",
9
- "dc_subject_sm": [
10
- "Elections",
11
- "Political Parties",
12
- "Voting",
13
- "Politics and government",
14
- "Boundaries",
15
- "Society"
16
- ],
17
- "dc_title_s": "Tripura, India: Post Delimitation State Assembly Constituency Boundaries and Election Data, 2008",
18
- "dc_type_s": "Dataset",
19
- "dct_isPartOf_sm": [
20
- "My Collection"
21
- ],
22
- "dct_references_sm": "{\"@context\":\"http://github.com/OSGeo/Cat-Interop\",\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"http://geowebservices-restricted.stanford.edu/geoserver/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"http://geowebservices-restricted.stanford.edu/geoserver/wms\",\"http://library.stanford.edu/iiif/image-api/1.1/context.json\":\"http://purl.stanford.edu/bw938nk9584.iiif\",\"http://schema.org/thumbnailUrl\":\"http://purl.stanford.edu/bw938nk9584.jpg\",\"http://schema.org/url\":\"http://purl.stanford.edu/bw938nk9584\",\"http://www.isotc211.org/schemas/2005/gmd/\":\"http://purl.stanford.edu/bw938nk9584.iso19139\",\"http://www.loc.gov/mods/v3\":\"http://purl.stanford.edu/bw938nk9584.mods\"}",
23
- "dct_spatial_sm": [
24
- "Tripura",
25
- "Belonia",
26
- "Dharmanagar",
27
- "Kalyanpur",
28
- "Khowai",
29
- "Badharghat",
30
- "Pabiachhara",
31
- "Salgarh",
32
- "Surma",
33
- "Town Bordowali",
34
- "Simna"
35
- ],
36
- "dct_temporal_sm": [
37
- "2008"
38
- ],
39
- "dct_issued_s": "2000",
40
- "dct_provenance_s": "Stanford",
41
- "georss_box_s": "22.948088 91.153656 24.521009 92.334389",
42
- "georss_polygon_s": "24.521009 91.153656 24.521009 92.334389 22.948088 92.334389 22.948088 91.153656 24.521009 91.153656",
43
- "layer_slug_s": "stanford-bw938nk9584",
44
- "layer_id_s": "druid:bw938nk9584",
45
- "layer_geom_type_s": "Polygon",
46
- "solr_bbox": "91.153656 22.948088 92.334389 24.521009",
47
- "solr_ne_pt": "24.521009,92.334389",
48
- "solr_sw_pt": "22.948088,91.153656",
49
- "solr_year_i": 2008,
50
- "solr_issued_dt": "2000-01-01T00:00:00Z",
51
- "solr_wms_url": "http://geowebservices-restricted.stanford.edu/geoserver/wms",
52
- "solr_wfs_url": "http://geowebservices-restricted.stanford.edu/geoserver/wfs"
53
- }]