Skip to content

Commit

Permalink
Merge pull request #93 from HandsOnDataViz/improve-markers
Browse files Browse the repository at this point in the history
Improve markers with customization, set hash to 1
  • Loading branch information
JackDougherty authored Oct 11, 2022
2 parents 44912cd + e4bdcbb commit 6f31146
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/storymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ $(window).on('load', function() {
L.marker([lat, lon], {
icon: L.ExtraMarkers.icon({
icon: 'fa-number',
number: c['Marker'] === 'Plain' ? '' : chapterCount,
number: c['Marker'] === 'Numbered'
? chapterCount
: (c['Marker'] === 'Plain'
? ''
: c['Marker']),
markerColor: c['Marker Color'] || 'blue'
}),
opacity: c['Marker'] === 'Hidden' ? 0 : 0.9,
Expand Down Expand Up @@ -290,7 +294,7 @@ $(window).on('load', function() {
) {

// Update URL hash
location.hash = i + 2;
location.hash = i + 1;

// Remove styling for the old in-focus chapter and
// add it to the new active chapter
Expand Down Expand Up @@ -441,7 +445,7 @@ $(window).on('load', function() {

// On first load, check hash and if it contains an number, scroll down
if (parseInt(location.hash.substr(1))) {
var containerId = parseInt( location.hash.substr(1) ) - 2;
var containerId = parseInt( location.hash.substr(1) ) - 1;
$('#contents').animate({
scrollTop: $('#container' + containerId).offset().top
}, 2000);
Expand Down

0 comments on commit 6f31146

Please sign in to comment.