Skip to content

Commit aa3b864

Browse files
crisnerjywarren
andcommitted
Fix build errors on lel version bump to 2.1.9 (#7340)
* bump LEL to 2.1.9 * Increase wait time in map test * Add baselayer and comment out layers * copying in @VladimirMikulic's system test optimizations Co-authored-by: Jeffrey Warren <[email protected]>
1 parent 23e83cd commit aa3b864

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

app/views/map/map.html.erb

+5-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
layersname = layersname.split(',')
9393
<% end %>
9494

95-
L.tileLayer(
95+
var baseLayer = L.tileLayer(
9696
"https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png",
9797
{
9898
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
@@ -101,7 +101,10 @@
101101

102102

103103
L.LayerGroup.EnvironmentalLayers({
104-
include: layersname,
104+
baseLayers: {
105+
'Gray-scale': baselayer
106+
},
107+
// include: layersname,
105108
hash: false,
106109
embed: true,
107110
hostname: 'publiclab.org',

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"junction": "theleagueof/junction#*",
4343
"leaflet": "^1.6.0",
4444
"leaflet-blurred-location": "^1.6.0",
45-
"leaflet-environmental-layers": "^2.1.7",
45+
"leaflet-environmental-layers": "^2.1.9",
4646
"leaflet-hash": "^0.2.1",
4747
"leaflet-spin": "1.1.0",
4848
"leaflet.fullscreen": "1.6.0",

test/system/map_test.rb

+20-9
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,46 @@
33
# https://guides.rubyonrails.org/testing.html#implementing-a-system-test
44

55
class MapTest < ApplicationSystemTestCase
6-
Capybara.default_max_wait_time = 90
6+
Capybara.default_max_wait_time = 60
77

88
test 'correct url hash for wiki map' do
99
visit '/map/chicago'
1010

11+
url_hash = page.evaluate_script("window.location.hash")
12+
13+
# Wait for any potential asynchronous operations to complete
14+
wait_for_ajax
15+
1116
# check that the url hash is correct
12-
assert_equal("#13/41.87/-87.64", page.evaluate_script("window.location.hash"))
13-
17+
assert_equal("#13/41.87/-87.64", url_hash)
1418
end
1519

1620
test 'show map by hash location' do
1721
visit '/map#9/-25/-13'
1822

1923
lat = page.evaluate_script("Math.round(map.getCenter().lat)")
20-
assert_equal(-25, lat)
21-
assert_equal(-25, page.evaluate_script("Math.round(map.getCenter().lat)"))
22-
assert_equal(-13, page.evaluate_script("Math.round(map.getCenter().lng)"))
23-
assert_equal(9, page.evaluate_script("map.getZoom()"))
24+
lng = page.evaluate_script("Math.round(map.getCenter().lng)")
25+
zoom = page.evaluate_script("map.getZoom()")
2426

27+
# Wait for any potential asynchronous operations to complete
28+
wait_for_ajax
29+
30+
assert_equal(-25, lat)
31+
assert_equal(-13, lng)
32+
assert_equal(9, zoom)
2533
end
2634

2735
test 'url hash updates when map panned' do
2836
visit '/map'
2937

3038
page.execute_script("map.setView([13, 60], 15)")
39+
url_hash = page.evaluate_script("window.location.hash")
40+
41+
# Wait for any potential asynchronous operations to complete
42+
wait_for_ajax
3143

3244
# check that the url hash is correct
33-
assert_equal("#15/13/60", page.evaluate_script("window.location.hash"))
34-
45+
assert_equal("#15/13/60", url_hash)
3546
end
3647

3748
end

yarn.lock

+13-4
Original file line numberDiff line numberDiff line change
@@ -3528,10 +3528,19 @@ leaflet-blurred-location@^1.5.1, leaflet-blurred-location@^1.6.0:
35283528
jquery "^3.2.1"
35293529
leaflet "^1.3.3"
35303530

3531-
leaflet-environmental-layers@^2.1.7:
3532-
version "2.1.7"
3533-
resolved "https://registry.yarnpkg.com/leaflet-environmental-layers/-/leaflet-environmental-layers-2.1.7.tgz#3d866404929db76b34b68d87460a6f5584bebccc"
3534-
integrity sha512-/lNjVMVZQBAydTWnTScWpDIx/1iPBlYp3MKI9sSKnU973Zj72du4VG7BPdlYxC6aPkKa3pHhWYNmk72E69SCSw==
3531+
"leaflet-blurred-location@git://github.com/publiclab/leaflet-blurred-location.git#main":
3532+
version "1.6.0"
3533+
uid ef66dcb768094680e92d4f972b68f18cd4db6ccc
3534+
resolved "git://github.com/publiclab/leaflet-blurred-location.git#ef66dcb768094680e92d4f972b68f18cd4db6ccc"
3535+
dependencies:
3536+
haversine-distance "^1.1.4"
3537+
jquery "^3.2.1"
3538+
leaflet "^1.3.3"
3539+
3540+
leaflet-environmental-layers@^2.1.9:
3541+
version "2.1.9"
3542+
resolved "https://registry.yarnpkg.com/leaflet-environmental-layers/-/leaflet-environmental-layers-2.1.9.tgz#48487bb7a2489d72411bd4112e00b3f5d21d4a7c"
3543+
integrity sha512-ur2ZtF/H17RIkKkTjc5Uhc7A3WAEkc9O2xfaFW1XS7hBiij6nkH1sckHZ9kZmkNFLHC0ifoymUi7n9k7p1VA+g==
35353544
dependencies:
35363545
jquery "^3.3.1"
35373546
leaflet "^1.3.1"

0 commit comments

Comments
 (0)