<div id="storyMap"></div>
html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
}

html,
body,
#storyMap {
  height: 100%;
  width: 100%;
}

/* story map container */
#storyMap {
  margin: 0 auto;
}

/* story map menu bar */
.vco-menubar-button,
.vco-mobile .vco-menubar-button:hover,
/* map icons */ .vco-map .vco-mapmarker {
  color: #fff;
}

.vco-menubar-button,
.vco-mobile .vco-menubar-button:hover {
  background-color: #0b3c5d;
}

.vco-menubar-button {
  -webkit-transition: background-color 0.2s ease-in-out;
  -moz-transition: background-color 0.2s ease-in-out;
  -o-transition: background-color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
}

.vco-menubar-button:hover,
.vco-menubar-button:focus,
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-next
  .vco-slidenav-icon:hover:before,
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-previous
  .vco-slidenav-icon:hover:before,
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-next
  .vco-slidenav-icon:focus:before,
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-previous
  .vco-slidenav-icon:focus:before,
.vco-mobile .vco-menubar-button:active {
  background-color: #d9b310;
}

.vco-storymap p a {
  color: #00e;
  text-decoration: underline;
}

.vco-map .vco-mapmarker-icon:after {
  content: url(https://raw.githubusercontent.com/pmacMaps/storymapsJS-pamagic-board/master/assets/images/pamagic-marker.png);
}

/* before and after buttons */
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-next
  .vco-slidenav-icon:before,
.vco-layout-landscape
  .vco-storyslider
  .vco-slidenav-previous
  .vco-slidenav-icon:before {
  background-color: #0b3c5d;
  -webkit-transition: background-color 0.2s ease-in-out;
  -moz-transition: background-color 0.2s ease-in-out;
  -o-transition: background-color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
}

.vco-mobile .vco-layout-landscape .vco-storyslider .vco-slidenav-next,
.vco-mobile .vco-layout-landscape .vco-storyslider .vco-slidenav-previous {
  display: none !important;
}

/* tour points text */
div.vco-storymap.vco-mobile.vco-layout-landscape
  > div.vco-storyslider.vco-storyslider {
  z-index: 1500;
}

.vco-slide-content {
  padding-top: 15px;
  padding-bottom: 15px;
  border-radius: 5px;
  background-color: #fff;
}

.vco-storymap h2.vco-headline-title {
  font-size: 1.5em;
}

.vco-headline,
.vco-storymap h2 {
  font-size: 1.4em;
}

.vco-text p {
  color: #333;
}

.vco-storymap p {
  line-height: 1.25em;
}

/* leaflet elements */
.vco-map .leaflet-container .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8);
  padding: 8px;
  border-radius: 5px;
}

.vco-map .leaflet-container .leaflet-control-attribution a {
  color: #00f;
}

/* Media Queries */
@media screen and (orientation: landscape) {
  .vco-slide-content {
    padding-left: 10px !important;
    margin-right: -20px !important;
  }
}

/* override zoom control being hidden */
@media screen and (max-width: 451px) {
  .vco-mobile.vco-skinny .leaflet-control-zoom {
    display: inherit;
  }

  div.leaflet-top.leaflet-left {
    margin-top: 20px;
  }
}

@media screen and (max-width: 768px) {
  .vco-media .vco-media-content-container .vco-media-content img {
    max-height: 250px;
  }

  .vco-storymap p {
    margin: 25px 0;
    font-size: 1.05em;
    line-height: 1.5em;
  }

  .vco-storymap p:first-child {
    margin-top: 10px;
  }

  .vco-storymap p:last-child {
    margin-bottom: 10px;
  }
}
"use strict";

// JSON file containing data for the Story Map
const storymap_data =
  "https://raw.githubusercontent.com/pmacMaps/storymapsJS-pamagic-board/master/assets/data/pamagicBoard.json";

// Options for Story Map
const storymap_options = {
  language: "en",
  map_type: "osm:standard",
  calculate_zoom: false
};

// the Story Map object
const storymap = new VCO.StoryMap("storyMap", storymap_data, storymap_options);

// Leaflet Zoom control
const zoomControl = L.control.zoom({ position: "topleft" });

// Leaflet Full-Screen control
const fullscreenControl = new L.Control.Fullscreen({
  position: "topleft"
});

// grouping of controls
const leafletControlsToAdd = [zoomControl, fullscreenControl];

// event for when the Story Map is loaded
storymap.on("loaded", function() {
  // leaflet.js web map object
  const leafletMap = storymap.map;

  // add controls to Leaflet web map
  leafletControlsToAdd.forEach(element => leafletMap.addControl(element));
});
Run Pen

External CSS

  1. https://cdn.knightlab.com/libs/storymapjs/latest/css/storymap.css
  2. https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css

External JavaScript

  1. https://cdn.knightlab.com/libs/storymapjs/latest/js/storymap-min.js
  2. https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js