Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
  <title>Urban Tree Map</title>
  <link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/light/main.css" />
  <script src='https://code.jquery.com/jquery-1.8.2.js'></script>

  <style>

  </style>

  <script src="https://js.arcgis.com/4.28/"></script>
  <script>
   
  </script>

</head>

<body class="calcite">
  <div id="topheader">
    <img id="logo" src="https://www.cityofadelaide.com.au/common/base/img/coa-logo-white.svg" alt="Urban Tree Map Logo">
    Urban Tree Map
  </div>
  <div class='popup-onload'>
    <div class='cnt223'>
      <div class="popup-content">
        <h2>Disclaimer!</h2>
        <p>Please enjoy this new version of the Urban Forest Map. The location and attributes of the trees are not 100% accurate. We are continuously improving the quality of the data and appearance of the map. More points will appear on this map as we increase our knowledge of our trees.</p>
        <a href='' class='close'>Close</a>
      </div>
    </div>
  </div>
  <div id="sidebar" class="esri-widget">
    <div id="text">
      <h1>Liberty Island</h1>
      <p>
        Note that setting the view.padding makes the view.center, view.extent etc work off a subsection of the full
        view.
      </p>
      <p>Try to resize the window to get a better understanding.</p>
    </div>
  </div>
  <div id="viewDiv"></div>
  <div id="info" class="esri-widget">Feature Count will appear here. If I manage to pull this off.</div>
</body>

</html>
              
            
!

CSS

              
                html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
      overflow: hidden;
    }

    #info {
      padding: 1em;
      max-width: 300px;
    }

    #topheader {
      display: flex;
      height: 50px;
      width: 100%;
      font: 36px bold;
      color: white;
      text-align: left;
      align-items: center;
      background-color: #002855;
    }

    #logo {
      padding-left: 10px;
      padding-right: 10px;
      max-height: 85%;
      max-width: 85%;
    }

    #overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: #000;
      filter: alpha(opacity=70);
      -moz-opacity: 0.7;
      -khtml-opacity: 0.7;
      opacity: 0.7;
      z-index: 100;
      display: none;
    }

    .popup-content {
      padding: 14px 10px;
      line-height: 1.5;
    }

    .cnt223 a {
      font: 24px bold;
      color: #Bb2424;
    }

    .popup-onload {
      margin: 0 auto;
      display: none;
      position: fixed;
      z-index: 101;
      top: 50%;
      left: 50%;
      margin-top: -300px;
      margin-left: -300px;
    }

    .cnt223 {
      min-width: 600px;
      width: 600px;
      min-height: 150px;
      margin: 100px auto;
      background: #f3f3f3;
      position: relative;
      z-index: 103;
      padding: 15px 35px;
      border-radius: 5px;
      box-shadow: 0 2px 5px #000;
    }

    .cnt223 p {
      clear: both;
      color: #555555;
      /* text-align: justify; */
      font-size: 20px;
      font-family: sans-serif;
    }

    .cnt223 p a {
      color: #d91900;
      font-weight: bold;
    }

    .cnt223 .x {
      float: right;
      height: 35px;
      left: 22px;
      position: relative;
      top: -25px;
      width: 34px;
    }

    .cnt223 .x:hover {
      cursor: pointer;
    }

    #sidebar {
      z-index: 99;
      top: 50px;
      position: absolute;
      top: 50px;
      float: left;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      width: 320px;
    }

    #text {
      color: white;
      padding: 3%;
    }
              
            
!

JS

              
                 require(["esri/views/MapView", "esri/widgets/Legend", "esri/WebMap"],
      (MapView, Legend, WebMap) => {
        const webmap = new WebMap({
          portalItem: {
            // autocasts as new PortalItem()
            id: "857bfed009034635b7c6943eb4d24403"
          }
        });
        const view = new MapView({
          container: "viewDiv",
          map: webmap
        });
        view.when(() => {
          // get the first layer in the collection of operational layers in the WebMap
          // when the resources in the MapView have loaded.
          const featureLayer = webmap.layers.getItemAt(0);
          const legend = new Legend({
            view: view,
            layerInfos: [{
              layer: featureLayer,
              title: "NY Educational Attainment"
            }]
          });
          // Add widget to the bottom right corner of the view
          //view.ui.add(legend, "bottom-left");
          view.ui.move("zoom", "bottom-right");
          view.ui.add("info", "top-right");
        });
      });

$(function() {
      var overlay = $('<div id="overlay"></div>');
      overlay.show();
      overlay.appendTo(document.body);
      $('.popup-onload').show();
      $('.close').click(function() {
        $('.popup-onload').hide();
        overlay.appendTo(document.body).remove();
        return false;
      });
      $('.x').click(function() {
        $('.popup').hide();
        overlay.appendTo(document.body).remove();
        return false;
      });
    });
              
            
!
999px

Console