Using Highmaps, an HTML5 mapping component optimized for creating schematic maps in web based projects, we will demonstrate how to add Javascript libraries to enhance your Drupal 8 site. Highmaps extends the user friendly Highcharts JavaScript API and allows web developers to build interactive maps with drilldown and touch support to display sales, election results or any other information linked to geography.
The JavaScript libraries have changed a lot in Drupal 8. JavaScript files which .info files called in Drupal 7 are now referenced in yml files. Stylesheets (CSS) and JavaScript (JS) are now loaded through the same system for modules (code) and themes, for everything: asset libraries. Using high-level principles, assets (CSS or JS) should only loaded when needed. Configurable Javascript is available with drupalSettings (the successor to Drupal 7's Drupal.settings). However, to make drupalSettings available to our JavaScript file: we have to declare a dependency on it. More info