Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <!--
  ArcGIS API for JavaScript, https://js.arcgis.com
  For more information about the watch-for-changes sample, read the original sample description at developers.arcgis.com.
  https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes/index.html
  -->
<title>Watch for changes - 4.10</title>

  <link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css">
  <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  <script src="https://js.arcgis.com/4.10/"></script>
</head>

<body>
  <div id="viewDiv">
    <img id='loading' src="https://i.stack.imgur.com/qq8AE.gif"/>
  </div>
</body>
</html>
              
            
!

CSS

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

#loading {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-right: -50%;
}
              
            
!

JS

              
                require([
    "esri/views/MapView",
    "esri/WebMap",
    "esri/core/watchUtils"
  ], function(MapView,
    WebMap, watchUtils, dom) {

    var webmap = new WebMap({
      portalItem: {
        id: "974c6641665a42bf8a57da08e607bb6f"
      }
    });

    const view = new MapView({
      container: "viewDiv",
      map: webmap
    });

    // Display the loading indicator when the view is updating
    watchUtils.whenTrue(view, "updating", function(evt) {
      $("#loading").show();
    });

    // Hide the loading indicator when the view stops updating
    watchUtils.whenFalse(view, "updating", function(evt) {
      $("#loading").hide();
    });

  });
              
            
!
999px

Console