-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #400 from freezingsaddles/ride-map-boundaries
Bound personal/hashtag ride maps
- Loading branch information
Showing
11 changed files
with
87 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,16 @@ | |
font-size: 1.1rem; | ||
} | ||
|
||
body.map-expanded { | ||
#map { | ||
aspect-ratio: 1.333; | ||
} | ||
|
||
#sect-stats { | ||
grid-template-columns: repeat(1, minmax(0, 1fr)); | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
#map, #cal { | ||
aspect-ratio: 1.333; | ||
|
@@ -63,6 +73,9 @@ | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" | ||
crossorigin=""></script> | ||
<!-- https://github.com/elmarquis/Leaflet.GestureHandling --> | ||
<link rel="stylesheet" href="/css/leaflet-gesture-handling.min.css" /> | ||
<script src="/js/leaflet-gesture-handling.min.js"></script> | ||
<script src="/js/ride-map.js"></script> | ||
{% endblock %} | ||
{% block beforenav %} | ||
|
@@ -250,6 +263,17 @@ <h3> | |
{% endif %} | ||
</div> | ||
<div id="map"> | ||
<div class="leaflet-control-container d-none d-xl-block"> | ||
<div class="leaflet-top leaflet-right"> | ||
<div class="leaflet-bar leaflet-control"> | ||
<a id="expand-map" | ||
class="leaflet-control-expand" | ||
href="#" | ||
role="button" | ||
title="Toggle full size">↹</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{# djlint:off H021 #} | ||
|
@@ -299,7 +323,13 @@ <h3> | |
{% block foot %} | ||
<script> | ||
$(() => { | ||
create_ride_map('map', '/api/all/trackmap.json'); | ||
const map = create_ride_map('map', '/api/all/trackmap.json'); | ||
$('#expand-map').click(e => { | ||
e.preventDefault(); | ||
$('body').toggleClass('map-expanded'); | ||
map.invalidateSize(); | ||
$('#map')[0].scrollIntoView({block: 'center'}); | ||
}) | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" | ||
crossorigin=""></script> | ||
<!-- https://github.com/elmarquis/Leaflet.GestureHandling --> | ||
<link rel="stylesheet" href="/css/leaflet-gesture-handling.min.css" /> | ||
<script src="/js/leaflet-gesture-handling.min.js"></script> | ||
<script src="/js/ride-map.js"></script> | ||
{% endblock %} | ||
{% block content %} | ||
|
@@ -124,7 +127,7 @@ <h3 class="accordion-header"> | |
<script type="text/javascript"> | ||
$(function() { | ||
$('#map-button').one('click', () => { | ||
create_ride_map('map', '/api/all/trackmap.json?hashtag={{data.hashtag_notag}}'); | ||
create_ride_map('map', '/api/all/trackmap.json?hashtag={{data.hashtag_notag}}', null, true); | ||
}); | ||
}); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" | ||
crossorigin=""></script> | ||
<!-- https://github.com/elmarquis/Leaflet.GestureHandling --> | ||
<link rel="stylesheet" href="/css/leaflet-gesture-handling.min.css" /> | ||
<script src="/js/leaflet-gesture-handling.min.js"></script> | ||
<script src="/js/ride-map.js"></script> | ||
<script type="text/javascript"> | ||
// Load the Visualization API and the corechart package. | ||
|
@@ -83,6 +86,14 @@ <h2 class="clearfix"> | |
role="tab" | ||
data-bs-toggle="tab">My Rides</a> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<a href="#map" | ||
id="map-link" | ||
class="nav-link" | ||
aria-controls="map" | ||
role="tab" | ||
data-bs-toggle="tab">My Ride Map</a> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<a href="#profile" | ||
class="nav-link" | ||
|
@@ -97,14 +108,6 @@ <h2 class="clearfix"> | |
role="tab" | ||
data-bs-toggle="tab">My Weekly Points</a> | ||
</li> | ||
<li role="presentation" class="nav-item"> | ||
<a href="#map" | ||
id="map-link" | ||
class="nav-link" | ||
aria-controls="map" | ||
role="tab" | ||
data-bs-toggle="tab">My Ride Map</a> | ||
</li> | ||
</ul> | ||
<!-- Tab panes --> | ||
<div class="tab-content"> | ||
|
@@ -272,7 +275,7 @@ <h2 class="clearfix"> | |
}); | ||
|
||
$('#map-link').one('click', () => { | ||
create_ride_map('map', '/api/my/trackmap.json', 'red'); | ||
create_ride_map('map', '/api/my/trackmap.json', 'red', true); | ||
}); | ||
}); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.