blacklight-maps 0.2.0 → 0.3.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/.gitignore +1 -0
- data/README.md +120 -42
- data/app/assets/javascripts/blacklight-maps.js +1 -2
- data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +122 -96
- data/app/assets/stylesheets/blacklight_maps/blacklight-maps.css.scss +5 -1
- data/app/assets/stylesheets/blacklight_maps/default.css.scss +74 -12
- data/app/helpers/blacklight/blacklight_maps_helper_behavior.rb +125 -0
- data/app/helpers/blacklight_maps_helper.rb +1 -24
- data/app/views/catalog/_document_maps.html.erb +1 -3
- data/app/views/catalog/_index_map.html.erb +7 -0
- data/app/views/catalog/_map_placename_search.html.erb +8 -0
- data/app/views/catalog/_map_spatial_search.html.erb +6 -0
- data/app/views/catalog/_show_maplet_default.html.erb +11 -0
- data/app/views/catalog/map.html.erb +8 -0
- data/blacklight-maps.gemspec +1 -2
- data/config/locales/blacklight-maps.en.yml +17 -1
- data/config/routes.rb +2 -2
- data/docs/blacklight-maps_index-view.png +0 -0
- data/docs/blacklight-maps_map-view.png +0 -0
- data/docs/blacklight-maps_search-control.png +0 -0
- data/docs/blacklight-maps_show-view.png +0 -0
- data/lib/blacklight/maps.rb +16 -0
- data/lib/blacklight/maps/controller_override.rb +33 -0
- data/lib/blacklight/maps/engine.rb +14 -6
- data/lib/blacklight/maps/export.rb +102 -61
- data/lib/blacklight/maps/render_constraints_override.rb +62 -0
- data/lib/blacklight/maps/version.rb +1 -1
- data/lib/generators/blacklight_maps/templates/blacklight_maps.css.scss +1 -1
- data/solr_conf/conf/schema.xml +4 -1
- data/spec/controllers/catalog_controller_spec.rb +22 -0
- data/spec/features/maps_spec.rb +194 -61
- data/spec/fixtures/sample_solr_documents.yml +73 -72
- data/spec/helpers/blacklight_maps_helper_spec.rb +134 -12
- data/spec/lib/blacklight/maps/controller_override_spec.rb +34 -0
- data/spec/lib/blacklight/maps/export_spec.rb +178 -35
- data/spec/lib/blacklight/maps/render_constraints_override_spec.rb +95 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/test_app_templates/Gemfile.extra +0 -2
- metadata +22 -21
- data/app/views/catalog/_index_maps.html.erb +0 -9
- data/docs/map-sidebar.png +0 -0
- data/docs/map-view.png +0 -0
@@ -58,7 +58,6 @@
|
|
58
58
|
language_facet:
|
59
59
|
- Urdu
|
60
60
|
timestamp: '2014-02-03T18:42:53.056Z'
|
61
|
-
placename_coords: []
|
62
61
|
- lc_1letter_facet:
|
63
62
|
- M - Music
|
64
63
|
author_t:
|
@@ -113,7 +112,6 @@
|
|
113
112
|
language_facet:
|
114
113
|
- Urdu
|
115
114
|
timestamp: '2014-02-03T18:42:53.056Z'
|
116
|
-
placename_coords: []
|
117
115
|
- subtitle_display: 'guft va gū-yi Akbar Ganjī bā ʻAbd Allāh Nūrī : bih payvast-i
|
118
116
|
matn-i istīz̤āḥ-i ʻAbd Allāh Nūrī dar Majlis-i panjum'
|
119
117
|
author_vern_display: "نورى، عبد الله"
|
@@ -251,9 +249,10 @@
|
|
251
249
|
language_facet:
|
252
250
|
- Persian
|
253
251
|
timestamp: '2014-02-03T18:42:53.056Z'
|
254
|
-
|
255
|
-
|
256
|
-
|
252
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[53.688046,32.427908]},\"properties\":{\"placename\":\"Iran\"}}"
|
253
|
+
coordinates:
|
254
|
+
- 53.688046 32.427908
|
255
|
+
- 44.0318907 25.0594286 63.3333366 39.7816755
|
257
256
|
- author_t:
|
258
257
|
- Yoshida, Hajime,
|
259
258
|
- "吉田一"
|
@@ -335,9 +334,10 @@
|
|
335
334
|
language_facet:
|
336
335
|
- Japanese
|
337
336
|
timestamp: '2014-02-03T18:42:53.056Z'
|
338
|
-
|
339
|
-
|
340
|
-
|
337
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[138.252924,36.204824]},\"properties\":{\"placename\":\"Japan\"}}"
|
338
|
+
coordinates:
|
339
|
+
- 138.252924 36.204824
|
340
|
+
- 122.9338302 24.0460446 153.9874305 45.5227719
|
341
341
|
- lc_1letter_facet:
|
342
342
|
- D - World History
|
343
343
|
author_t:
|
@@ -407,9 +407,10 @@
|
|
407
407
|
language_facet:
|
408
408
|
- Russian
|
409
409
|
timestamp: '2014-02-03T18:42:53.056Z'
|
410
|
-
|
411
|
-
|
412
|
-
|
410
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[66.923684,48.019573]},\"properties\":{\"placename\":\"Kazakhstan\"}}"
|
411
|
+
coordinates:
|
412
|
+
- 66.923684 48.019573
|
413
|
+
- 46.4936719 40.568584 87.315415 55.441984
|
413
414
|
- lc_1letter_facet:
|
414
415
|
- K - Law
|
415
416
|
author_t:
|
@@ -482,7 +483,6 @@
|
|
482
483
|
language_facet:
|
483
484
|
- Russian
|
484
485
|
timestamp: '2014-02-03T18:42:53.056Z'
|
485
|
-
placename_coords: []
|
486
486
|
- lc_1letter_facet:
|
487
487
|
- D - World History
|
488
488
|
marc_display: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><collection xmlns=\"http://www.loc.gov/MARC21/slim\"><record><leader>01062cam
|
@@ -572,9 +572,10 @@
|
|
572
572
|
language_facet:
|
573
573
|
- Korean
|
574
574
|
timestamp: '2014-02-03T18:42:53.056Z'
|
575
|
-
|
576
|
-
|
577
|
-
|
575
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[127.766922,35.907757]},\"properties\":{\"placename\":\"Korea\"}}"
|
576
|
+
coordinates:
|
577
|
+
- 124.608139 33.1061096 130.9232178 38.6169312
|
578
|
+
- 127.766922 35.907757
|
578
579
|
- lc_1letter_facet:
|
579
580
|
- P - Language & Literature
|
580
581
|
author_t:
|
@@ -641,7 +642,6 @@
|
|
641
642
|
language_facet:
|
642
643
|
- Sanskrit
|
643
644
|
timestamp: '2014-02-03T18:42:53.056Z'
|
644
|
-
placename_coords: []
|
645
645
|
- lc_1letter_facet:
|
646
646
|
- H - Social Sciences
|
647
647
|
author_t:
|
@@ -705,9 +705,12 @@
|
|
705
705
|
language_facet:
|
706
706
|
- Urdu
|
707
707
|
timestamp: '2014-02-03T18:42:53.056Z'
|
708
|
-
|
709
|
-
-
|
710
|
-
|
708
|
+
geojson:
|
709
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[69.34511599999999,30.375321]},\"properties\":{\"placename\":\"Pakistan\"}}"
|
710
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[60.872972, 23.6946945], [77.8334694, 23.6946945], [77.8334694, 37.084107], [60.872972, 37.084107], [60.872972, 23.6946945]]]},\"bbox\":[60.872972, 23.6946945, 77.8334694, 37.084107]}"
|
711
|
+
coordinates:
|
712
|
+
- 60.872972 23.6946945 77.8334694 37.084107
|
713
|
+
- 69.34511599999999 30.375321
|
711
714
|
- lc_1letter_facet:
|
712
715
|
- M - Music
|
713
716
|
author_t:
|
@@ -766,7 +769,6 @@
|
|
766
769
|
language_facet:
|
767
770
|
- Sanskrit
|
768
771
|
timestamp: '2014-02-03T18:42:53.056Z'
|
769
|
-
placename_coords: []
|
770
772
|
- subtitle_display: sipurim mafliʼim ha-mevusasim ʻal ʻuvdot hisṭoriyot
|
771
773
|
author_vern_display: "פינקל, חיים יעקב"
|
772
774
|
subject_addl_t:
|
@@ -862,7 +864,6 @@
|
|
862
864
|
language_facet:
|
863
865
|
- Hebrew
|
864
866
|
timestamp: '2014-02-03T18:42:53.056Z'
|
865
|
-
placename_coords: []
|
866
867
|
- lc_1letter_facet:
|
867
868
|
- B - Philosophy, Psychology, Religion
|
868
869
|
author_t:
|
@@ -963,7 +964,6 @@
|
|
963
964
|
language_facet:
|
964
965
|
- Persian
|
965
966
|
timestamp: '2014-02-03T18:42:53.056Z'
|
966
|
-
placename_coords: []
|
967
967
|
- lc_1letter_facet:
|
968
968
|
- M - Music
|
969
969
|
author_t:
|
@@ -1020,7 +1020,6 @@
|
|
1020
1020
|
subtitle_t:
|
1021
1021
|
- tʻeoriul-metʻoduri narkvevi /
|
1022
1022
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1023
|
-
placename_coords: []
|
1024
1023
|
- lc_1letter_facet:
|
1025
1024
|
- K - Law
|
1026
1025
|
author_t:
|
@@ -1107,9 +1106,8 @@
|
|
1107
1106
|
language_facet:
|
1108
1107
|
- Korean
|
1109
1108
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1110
|
-
|
1111
|
-
|
1112
|
-
place_bbox: 124.608139 33.1061096 130.9232178 38.6169312
|
1109
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[127.766922,35.907757]},\"properties\":{\"placename\":\"Korea (North)\"}}"
|
1110
|
+
coordinates: 127.766922 35.907757
|
1113
1111
|
- subtitle_display: ṿe-hu perush yafeh u-menupeh ʻal Shulḥan ʻarukh Oraḥ ḥayim
|
1114
1112
|
asher ḥiber Yosef Ḳaro ... ʻim ḥidushe dinim she-hishmiṭ ha-gaʼon ... ṿe-himtsiʼam
|
1115
1113
|
... Mosheh Iserlish
|
@@ -1274,7 +1272,6 @@
|
|
1274
1272
|
language_facet:
|
1275
1273
|
- Hebrew
|
1276
1274
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1277
|
-
placename_coords: []
|
1278
1275
|
- subtitle_display: 'kangnam yŏin kwa sin pʻalbulchʻul : Kim Hong-sin setʻae rŭpʻo'
|
1279
1276
|
author_vern_display: "김 홍신, 1947-"
|
1280
1277
|
subject_addl_t:
|
@@ -1369,12 +1366,12 @@
|
|
1369
1366
|
language_facet:
|
1370
1367
|
- Korean
|
1371
1368
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1372
|
-
|
1373
|
-
- Seoul (Korea)
|
1374
|
-
- Korea (South)
|
1375
|
-
|
1376
|
-
- 126.
|
1377
|
-
-
|
1369
|
+
geojson:
|
1370
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[126.9779692,37.566535]},\"properties\":{\"placename\":\"Seoul (Korea)\"}}"
|
1371
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[127.766922,35.907757]},\"properties\":{\"placename\":\"Korea (South)\"}}"
|
1372
|
+
coordinates:
|
1373
|
+
- 126.9779692 37.566535
|
1374
|
+
- 127.766922 35.907757
|
1378
1375
|
- subtitle_display: dar khiradvarzī-i siyāsī va huvīyat-i mā Īrānīyān
|
1379
1376
|
author_vern_display: "رجايى، فرهنگ ."
|
1380
1377
|
subject_addl_t:
|
@@ -1483,9 +1480,10 @@
|
|
1483
1480
|
language_facet:
|
1484
1481
|
- Persian
|
1485
1482
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1483
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[53.688046,32.427908]},\"properties\":{\"placename\":\"Iran\"}}"
|
1484
|
+
coordinates:
|
1485
|
+
- 53.688046 32.427908
|
1486
|
+
- 44.0318907 25.0594286 63.3333366 39.7816755
|
1489
1487
|
- lc_1letter_facet:
|
1490
1488
|
- P - Language & Literature
|
1491
1489
|
author_t:
|
@@ -1573,7 +1571,6 @@
|
|
1573
1571
|
language_facet:
|
1574
1572
|
- Sanskrit
|
1575
1573
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1576
|
-
placename_coords: []
|
1577
1574
|
- lc_1letter_facet:
|
1578
1575
|
- U - Military Science
|
1579
1576
|
author_t:
|
@@ -1664,7 +1661,6 @@
|
|
1664
1661
|
language_facet:
|
1665
1662
|
- Arabic
|
1666
1663
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1667
|
-
placename_coords: []
|
1668
1664
|
- lc_1letter_facet:
|
1669
1665
|
- D - World History
|
1670
1666
|
author_t:
|
@@ -1733,7 +1729,6 @@
|
|
1733
1729
|
language_facet:
|
1734
1730
|
- Tibetan
|
1735
1731
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1736
|
-
placename_coords: []
|
1737
1732
|
- subtitle_display: min jald al-dhāt ilá ṣidq al-sharḥ
|
1738
1733
|
author_vern_display: "أبو الخير، علي عبد الحميد"
|
1739
1734
|
subject_addl_t:
|
@@ -1822,7 +1817,6 @@
|
|
1822
1817
|
language_facet:
|
1823
1818
|
- Arabic
|
1824
1819
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1825
|
-
placename_coords: []
|
1826
1820
|
- lc_1letter_facet:
|
1827
1821
|
- H - Social Sciences
|
1828
1822
|
marc_display: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><collection xmlns=\"http://www.loc.gov/MARC21/slim\"><record><leader>03730cam
|
@@ -1996,9 +1990,12 @@
|
|
1996
1990
|
language_facet:
|
1997
1991
|
- Hebrew
|
1998
1992
|
timestamp: '2014-02-03T18:42:53.056Z'
|
1999
|
-
|
2000
|
-
-
|
2001
|
-
|
1993
|
+
geojson:
|
1994
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[34.851612, 31.046051]},\"properties\":{\"placename\":\"Israel\"}}"
|
1995
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[34.267387, 29.47969999999999], [35.896244, 29.47969999999999], [35.896244, 33.33280500000001], [34.267387, 33.33280500000001], [34.267387, 29.47969999999999]]]},\"bbox\":[34.267387, 29.47969999999999, 35.896244, 33.33280500000001]}"
|
1996
|
+
coordinates:
|
1997
|
+
- 34.267387 29.47969999999999 35.896244 33.33280500000001
|
1998
|
+
- 34.851612 31.046051
|
2002
1999
|
- lc_1letter_facet:
|
2003
2000
|
- E - History of the Americas (General)
|
2004
2001
|
author_t:
|
@@ -2107,10 +2104,12 @@
|
|
2107
2104
|
subtitle_t:
|
2108
2105
|
- 'a Native American elder has her say : an oral history /'
|
2109
2106
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2110
|
-
|
2111
|
-
- New Jersey
|
2112
|
-
-
|
2113
|
-
|
2107
|
+
geojson:
|
2108
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[74.4056612,40.0583238]},\"properties\":{\"placename\":\"New Jersey\"}}"
|
2109
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[75.2340768,39.427337]},\"properties\":{\"placename\":\"Bridgeton\"}}"
|
2110
|
+
coordinates:
|
2111
|
+
- 74.4056612 40.0583238
|
2112
|
+
- 75.2340768 39.427337
|
2114
2113
|
- lc_1letter_facet:
|
2115
2114
|
- B - Philosophy, Psychology, Religion
|
2116
2115
|
author_t:
|
@@ -2191,7 +2190,6 @@
|
|
2191
2190
|
- dam paʼi chos dgoṅs pa gcig paʼi dri ba legs bśad bsu baʼi pho ñaʼi dris lan
|
2192
2191
|
Dgoṅs-gcig smra baʼi mdzes rgyan źes bya ba bźugs so /
|
2193
2192
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2194
|
-
placename_coords: []
|
2195
2193
|
- subtitle_display: a supplication to the noble Lama Mahaguru Padmasambhava
|
2196
2194
|
subject_addl_t:
|
2197
2195
|
- Prayers and devotions
|
@@ -2297,9 +2295,12 @@
|
|
2297
2295
|
- English
|
2298
2296
|
- Tibetan
|
2299
2297
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2300
|
-
|
2301
|
-
-
|
2302
|
-
|
2298
|
+
geojson:
|
2299
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[78.96288,20.593684]},\"properties\":{\"placename\":\"India\"}}"
|
2300
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[68.162386, 6.7535159], [97.395555, 6.7535159], [97.395555, 35.5044752], [68.162386, 35.5044752], [68.162386, 6.7535159]]]},\"bbox\":[68.162386, 6.7535159, 97.395555, 35.5044752]}"
|
2301
|
+
coordinates:
|
2302
|
+
- 68.162386 6.7535159 97.395555 35.5044752
|
2303
|
+
- 78.96288 20.593684
|
2303
2304
|
- lc_1letter_facet:
|
2304
2305
|
- B - Philosophy, Psychology, Religion
|
2305
2306
|
author_t:
|
@@ -2380,7 +2381,6 @@
|
|
2380
2381
|
- goṅ sa skyabs mgon chen po mchog nas deṅ dus Bod rigs na gźon rnams la naṅ
|
2381
2382
|
chos ṅo sprod bstsal ba bźugs so.
|
2382
2383
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2383
|
-
placename_coords: []
|
2384
2384
|
- lc_1letter_facet:
|
2385
2385
|
- D - World History
|
2386
2386
|
author_t:
|
@@ -2415,7 +2415,7 @@
|
|
2415
2415
|
tag=\"520\" ind1=\" \" ind2=\" \"><subfield code=\"a\">History of Tibet in questions/answers
|
2416
2416
|
format.</subfield></datafield><datafield tag=\"504\" ind1=\" \" ind2=\" \"><subfield
|
2417
2417
|
code=\"a\">Includes bibliographical references (p. 406-407).</subfield></datafield><datafield
|
2418
|
-
tag=\"651\" ind1=\" \" ind2=\"0\"><subfield code=\"a\">Tibet
|
2418
|
+
tag=\"651\" ind1=\" \" ind2=\"0\"><subfield code=\"a\">Tibet</subfield><subfield
|
2419
2419
|
code=\"x\">History</subfield><subfield code=\"v\">Miscellanea.</subfield></datafield><datafield
|
2420
2420
|
tag=\"710\" ind1=\"2\" ind2=\" \"><subfield code=\"a\">Rnam-rgyal Grwa-tshaṅ.</subfield></datafield></record></collection>"
|
2421
2421
|
published_display:
|
@@ -2439,7 +2439,7 @@
|
|
2439
2439
|
subject_addl_t:
|
2440
2440
|
- History Miscellanea
|
2441
2441
|
subject_t:
|
2442
|
-
- Tibet
|
2442
|
+
- Tibet
|
2443
2443
|
title_sort: bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel
|
2444
2444
|
gyi me loṅ źes bya ba bźugs so
|
2445
2445
|
id: '2008308202'
|
@@ -2450,7 +2450,7 @@
|
|
2450
2450
|
loṅ źes bya ba bźugs so /
|
2451
2451
|
- Rgyal rabs dris lan brgya pa rab gsal śel gyi me loṅ
|
2452
2452
|
subject_geo_facet:
|
2453
|
-
- Tibet
|
2453
|
+
- Tibet
|
2454
2454
|
author_addl_t:
|
2455
2455
|
- Rnam-rgyal Grwa-tshaṅ.
|
2456
2456
|
lc_alpha_facet:
|
@@ -2458,9 +2458,8 @@
|
|
2458
2458
|
language_facet:
|
2459
2459
|
- Tibetan
|
2460
2460
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2461
|
-
|
2462
|
-
|
2463
|
-
place_bbox: 78.3955448 26.8548157 99.116241 36.4833345
|
2461
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[91.117212,29.646923]},\"properties\":{\"placename\":\"Tibet\"}}"
|
2462
|
+
coordinates: 91.117212 29.646923
|
2464
2463
|
- marc_display: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><collection xmlns=\"http://www.loc.gov/MARC21/slim\"><record><leader>01127cam
|
2465
2464
|
a22002895a 4500</leader><controlfield tag=\"001\"> 2008308478</controlfield><controlfield
|
2466
2465
|
tag=\"003\">DLC</controlfield><controlfield tag=\"005\">20090123131001.0</controlfield><controlfield
|
@@ -2535,12 +2534,14 @@
|
|
2535
2534
|
language_facet:
|
2536
2535
|
- Tibetan
|
2537
2536
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2538
|
-
|
2539
|
-
-
|
2540
|
-
-
|
2541
|
-
-
|
2542
|
-
|
2543
|
-
|
2537
|
+
geojson:
|
2538
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[104.195397,35.86166]},\"properties\":{\"placename\":\"China\"}}"
|
2539
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[91.117212,29.646923]},\"properties\":{\"placename\":\"Tibet\"}}"
|
2540
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[78.96288,20.593684]},\"properties\":{\"placename\":\"India\"}}"
|
2541
|
+
coordinates:
|
2542
|
+
- 104.195397 35.86166
|
2543
|
+
- 91.117212 29.646923
|
2544
|
+
- 78.96288 20.593684
|
2544
2545
|
- author_vern_display: "吉田一, 1934-"
|
2545
2546
|
subject_addl_t:
|
2546
2547
|
- 20th century History and criticism
|
@@ -2646,9 +2647,8 @@
|
|
2646
2647
|
language_facet:
|
2647
2648
|
- Japanese
|
2648
2649
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2649
|
-
|
2650
|
-
|
2651
|
-
place_bbox: 122.9338302 24.0460446 153.9874305 45.5227719
|
2650
|
+
geojson: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[138.252924,36.204824]},\"properties\":{\"placename\":\"Japan\"}}"
|
2651
|
+
coordinates: 138.252924 36.204824
|
2652
2652
|
- author_vern_display: "林行止"
|
2653
2653
|
subject_addl_t:
|
2654
2654
|
- 1990-
|
@@ -2753,8 +2753,9 @@
|
|
2753
2753
|
language_facet:
|
2754
2754
|
- Chinese
|
2755
2755
|
timestamp: '2014-02-03T18:42:53.056Z'
|
2756
|
-
|
2757
|
-
-
|
2758
|
-
-
|
2759
|
-
|
2760
|
-
|
2756
|
+
geojson:
|
2757
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[114.109497,22.396428]},\"properties\":{\"placename\":\"Hong Kong (China)\"}}"
|
2758
|
+
- "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[113.835078, 22.1533884], [114.4069561, 22.1533884], [114.4069561, 22.561968], [113.835078, 22.561968], [113.835078, 22.1533884]]]},\"bbox\":[113.835078, 22.1533884, 114.4069561, 22.561968]}"
|
2759
|
+
coordinates:
|
2760
|
+
- 113.835078 22.1533884 114.4069561 22.561968
|
2761
|
+
- 114.109497 22.396428
|
@@ -14,27 +14,26 @@ describe BlacklightMapsHelper do
|
|
14
14
|
|
15
15
|
before :each do
|
16
16
|
CatalogController.blacklight_config = Blacklight::Configuration.new
|
17
|
-
CatalogController.configure_blacklight do |config|
|
18
|
-
config.view.maps.type = 'placename_coord'
|
19
|
-
|
20
|
-
# These fields also need to be added for some reason for the tests to pass
|
21
|
-
# Link in list is not being generated correctly if not passed
|
22
|
-
config.index.title_field = 'title_display'
|
23
|
-
end
|
24
17
|
helper.stub(blacklight_config: blacklight_config)
|
25
|
-
helper.instance_variable_set(:@response, r)
|
26
18
|
@request = ActionDispatch::TestRequest.new
|
27
19
|
@catalog = CatalogController.new
|
28
20
|
@catalog.request = @request
|
21
|
+
@catalog.action_name = "index"
|
29
22
|
helper.instance_variable_set(:@_controller, @catalog)
|
23
|
+
@docs = r.facet_by_field_name(blacklight_config.view.maps.geojson_field).items
|
24
|
+
@geojson_hash = {type:"Feature", geometry:{type:"Point",coordinates:[91.117212, 29.646923]},properties:{placename:"Tibet"}}
|
25
|
+
@coords = [91.117212,29.646923]
|
26
|
+
@bbox = [78.3955448,26.8548157,99.116241,36.4833345]
|
30
27
|
end
|
31
28
|
|
32
|
-
describe "
|
29
|
+
describe "blacklight_map_tag" do
|
33
30
|
|
34
31
|
context "with default values" do
|
35
32
|
subject { helper.blacklight_map_tag('blacklight-map') }
|
36
33
|
it { should have_selector "div#blacklight-map" }
|
37
|
-
it { should have_selector "div[data-maxzoom='
|
34
|
+
it { should have_selector "div[data-maxzoom='#{blacklight_config.view.maps.maxzoom}']" }
|
35
|
+
it { should have_selector "div[data-tileurl='#{blacklight_config.view.maps.tileurl}']" }
|
36
|
+
it { should have_selector "div[data-mapattribution='#{blacklight_config.view.maps.mapattribution}']" }
|
38
37
|
end
|
39
38
|
|
40
39
|
context "with custom values" do
|
@@ -50,13 +49,136 @@ describe BlacklightMapsHelper do
|
|
50
49
|
end
|
51
50
|
|
52
51
|
describe "serialize_geojson" do
|
52
|
+
|
53
53
|
it "should return geojson of documents" do
|
54
|
-
expect(helper.serialize_geojson).to include('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point"')
|
54
|
+
expect(helper.serialize_geojson(@docs)).to include('{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point"')
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "placename_value" do
|
60
|
+
|
61
|
+
it "should return the placename value" do
|
62
|
+
expect(helper.placename_value(@geojson_hash)).to eq('Tibet')
|
55
63
|
end
|
64
|
+
|
56
65
|
end
|
57
66
|
|
67
|
+
describe "link_to_bbox_search" do
|
68
|
+
|
69
|
+
before do
|
70
|
+
@bbox = [78.3955448,26.8548157,99.116241,36.4833345]
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should create a spatial search link" do
|
74
|
+
expect(helper.link_to_bbox_search(@bbox)).to include('catalog?coordinates')
|
75
|
+
expect(helper.link_to_bbox_search(@bbox)).to include('spatial_search_type=bbox')
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "link_to_placename_field" do
|
81
|
+
|
82
|
+
it "should create a link to the placename field" do
|
83
|
+
expect(helper.link_to_placename_field('Tibet', blacklight_config.view.maps.placename_field)).to include("catalog?f%5B#{blacklight_config.view.maps.placename_field}%5D%5B%5D=Tibet")
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should create a link to the placename field using the display value" do
|
87
|
+
expect(helper.link_to_placename_field('Tibet', blacklight_config.view.maps.placename_field, 'foo')).to include('">foo</a>')
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "link_to_point_search" do
|
93
|
+
|
94
|
+
before do
|
95
|
+
@coords = [91.117212,29.646923]
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should create a link to a coordinate point" do
|
99
|
+
expect(helper.link_to_point_search(@coords)).to include('catalog?coordinates')
|
100
|
+
expect(helper.link_to_point_search(@coords)).to include('spatial_search_type=point')
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
describe "map_facet_field" do
|
106
|
+
|
107
|
+
it "should return the correct facet field" do
|
108
|
+
expect(helper.map_facet_field).to eq(blacklight_config.view.maps.geojson_field)
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "map_facet_values" do
|
114
|
+
|
115
|
+
before do
|
116
|
+
@response = r
|
117
|
+
end
|
118
|
+
|
119
|
+
it "should return an array of Blacklight::SolrResponse::Facets::FacetItem items" do
|
120
|
+
expect(helper.map_facet_values.class).to eq(Array)
|
121
|
+
expect(helper.map_facet_values.first.class).to eq(Blacklight::SolrResponse::Facets::FacetItem)
|
122
|
+
expect(helper.map_facet_values.length).to eq(5)
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
describe "render_placename_heading" do
|
128
|
+
|
129
|
+
it "should return the placename heading" do
|
130
|
+
expect(helper.render_placename_heading(@geojson_hash)).to eq('Tibet')
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "render_index_map" do
|
136
|
+
|
137
|
+
before do
|
138
|
+
@response = r
|
139
|
+
end
|
140
|
+
|
141
|
+
it "should render the 'catalog/index_map' partial" do
|
142
|
+
expect(helper.render_index_map).to include("$('#blacklight-index-map').blacklight_leaflet_map")
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
describe "render_spatial_search_link" do
|
148
|
+
|
149
|
+
it "should return link_to_bbox_search if bbox coordinates are passed" do
|
150
|
+
expect(helper.render_spatial_search_link(@bbox)).to include('spatial_search_type=bbox')
|
151
|
+
end
|
152
|
+
|
153
|
+
it "should return link_to_point_search if point coordinates are passed" do
|
154
|
+
expect(helper.render_spatial_search_link(@coords)).to include('spatial_search_type=point')
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
158
|
+
|
159
|
+
describe "set_viewpoint" do
|
160
|
+
|
161
|
+
describe "map with a single point" do
|
162
|
+
|
163
|
+
it "should return a coordinate array matching the point" do
|
164
|
+
expect(helper.set_viewpoint(helper.serialize_geojson([@docs.first]))).to eq([29.646923, 91.117212])
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
describe "map with multiple points" do
|
170
|
+
|
171
|
+
it "should return an array of coordinates with the max lat-long of the range of points" do
|
172
|
+
expect(helper.set_viewpoint(helper.serialize_geojson(@docs))).to eq([[20.593684, 78.96288], [35.86166, 104.195397]])
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
end
|
178
|
+
|
179
|
+
|
58
180
|
def mock_query_response
|
59
|
-
%({"responseHeader"=>{"status"=>0, "QTime"=>14, "params"=>{"q"=>"tibet", "spellcheck.q"=>"tibet", "qt"=>"search", "wt"=>"ruby", "rows"=>"10"}}, "response"=>{"numFound"=>2, "start"=>0, "maxScore"=>0.016135123, "docs"=>[{"published_display"=>["Dharamsala, H.P."], "author_display"=>"Thub-bstan-yar-ʼphel, Rnam-grwa", "lc_callnum_display"=>["DS785 .T475 2005"], "pub_date"=>["2005"], "format"=>"Book", "material_type_display"=>["a-e, iv, ii, 407 p."], "title_display"=>"Bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel gyi me loṅ źes bya ba bźugs so", "id"=>"2008308202", "subject_geo_facet"=>["Tibet
|
181
|
+
%({"responseHeader"=>{"status"=>0, "QTime"=>14, "params"=>{"q"=>"tibet", "spellcheck.q"=>"tibet", "qt"=>"search", "wt"=>"ruby", "rows"=>"10"}}, "response"=>{"numFound"=>2, "start"=>0, "maxScore"=>0.016135123, "docs"=>[{"published_display"=>["Dharamsala, H.P."], "author_display"=>"Thub-bstan-yar-ʼphel, Rnam-grwa", "lc_callnum_display"=>["DS785 .T475 2005"], "pub_date"=>["2005"], "format"=>"Book", "material_type_display"=>["a-e, iv, ii, 407 p."], "title_display"=>"Bod gaṅs can gyi rgyal rabs mdor bsdus dris lan brgya pa rab gsal śel gyi me loṅ źes bya ba bźugs so", "id"=>"2008308202", "subject_geo_facet"=>["Tibet"], "language_facet"=>["Tibetan"], "geojson"=>["{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[91.117212, 29.646923]},\\"properties\\":{\\"placename\\":\\"Tibet\\"}}", "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Polygon\\",\\"coordinates\\":[[[78.3955448, 26.8548157], [99.116241, 26.8548157], [99.116241, 36.4833345], [78.3955448, 36.4833345], [78.3955448, 26.8548157]]]},\\"bbox\\":[78.3955448,26.8548157,99.116241,36.4833345]}"], "coordinates"=>["91.117212 29.646923", "78.3955448 26.8548157 99.116241 36.4833345"], "score"=>0.016135123}, {"published_display"=>["Dharamsala, Distt. Kangra, H.P."], "pub_date"=>["2007"], "format"=>"Book", "title_display"=>"Ses yon", "material_type_display"=>["xii, 419 p."], "id"=>"2008308478", "subject_geo_facet"=>["China", "Tibet", "India"], "subject_topic_facet"=>["Education and state", "Tibetans", "Tibetan language", "Teaching"], "language_facet"=>["Tibetan"], "geojson"=>["{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[104.195397,35.86166]},\\"properties\\":{\\"placename\\":\\"China\\"}}", "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[91.117212,29.646923]},\\"properties\\":{\\"placename\\":\\"Tibet\\"}}", "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[78.96288,20.593684]},\\"properties\\":{\\"placename\\":\\"India\\"}}","{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Polygon\\",\\"coordinates\\":[[[68.162386, 6.7535159], [97.395555, 6.7535159], [97.395555, 35.5044752], [68.162386, 35.5044752], [68.162386, 6.7535159]]]},\\"bbox\\":[68.162386,6.7535159,97.395555,35.5044752]}"], "coordinates"=>["68.162386 6.7535159 97.395555 35.5044752", "104.195397 35.86166", "91.117212 29.646923", "78.96288 20.593684"], "score"=>0.0026767207}]}, "facet_counts"=>{"facet_queries"=>{}, "facet_fields"=>{"format"=>["Book", 2], "lc_1letter_facet"=>["D - World History", 1], "lc_alpha_facet"=>["DS", 1], "lc_b4cutter_facet"=>["DS785", 1], "language_facet"=>["Tibetan", 2], "pub_date"=>["2005", 1, "2007", 1], "subject_era_facet"=>[], "subject_geo_facet"=>["China", 1, "India", 1, "Tibet", 1, "Tibet (China)", 1], "coordinates"=>["91.117212 29.646923", 2, "78.3955448 26.8548157 99.116241 36.4833345", 1, "68.162386 6.7535159 97.395555 35.5044752", 1, "104.195397 35.86166", 1, "78.96288 20.593684", 1], "geojson"=>["{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[91.117212, 29.646923]},\\"properties\\":{\\"placename\\":\\"Tibet\\"}}", 2, "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Polygon\\",\\"coordinates\\":[[[78.3955448, 26.8548157], [99.116241, 26.8548157], [99.116241, 36.4833345], [78.3955448, 36.4833345], [78.3955448, 26.8548157]]]},\\"bbox\\":[78.3955448,26.8548157,99.116241,36.4833345]}", 1, "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[104.195397,35.86166]},\\"properties\\":{\\"placename\\":\\"China\\"}}", 1, "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Point\\",\\"coordinates\\":[78.96288,20.593684]},\\"properties\\":{\\"placename\\":\\"India\\"}}", 1, "{\\"type\\":\\"Feature\\",\\"geometry\\":{\\"type\\":\\"Polygon\\",\\"coordinates\\":[[[68.162386, 6.7535159], [97.395555, 6.7535159], [97.395555, 35.5044752], [68.162386, 35.5044752], [68.162386, 6.7535159]]]},\\"bbox\\":[68.162386,6.7535159,97.395555,35.5044752]}", 1], "subject_topic_facet"=>["Education and state", 1, "Teaching", 1, "Tibetan language", 1, "Tibetans", 1]}, "facet_dates"=>{}, "facet_ranges"=>{}}, "spellcheck"=>{"suggestions"=>["tibet", {"numFound"=>1, "startOffset"=>0, "endOffset"=>5, "origFreq"=>2, "suggestion"=>[{"word"=>"tibetan", "freq"=>6}]}, "correctlySpelled", true]}})
|
60
182
|
end
|
61
183
|
|
62
184
|
end
|