Pen Settings



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


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


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.


                <div id="viewDiv">


#viewDiv {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;

.esri-feature {
  letter-spacing: 0em;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  line-height: 1.55rem;
  font-feature-settings: "liga" 1, "calt" 0;
  background: #fff;
  padding: 1em;


], function(ArcGISMap, FeatureLayer, MapView, Feature) {

  const fLayer = new FeatureLayer({
    portalItem: {
      id: "b8c35f6b170340ca9f90c94724423851"
  const map = new ArcGISMap({
    basemap: "gray-vector",
    layers: [fLayer]
  const view = new MapView({
    container: "viewDiv",
    map: map
  fLayer.load().then(_ => {
    view.extent = fLayer.fullExtent;
  view.when().then(_ => {
    const graphic = {
      popupTemplate: {
        content: "Mouse over features to show details..."
    const feature = new Feature({
      graphic, view
    view.whenLayerView(fLayer).then(layerView => {
      let highlight;
      view.on("pointer-move", event => {
        view.hitTest(event).then(({ results }) => {
          const result = results[0];
          highlight && highlight.remove();
          if (result) {
            feature.graphic = result.graphic;
            highlight = layerView.highlight(result.graphic);
          else {
            feature.graphic = graphic;
    view.ui.add(feature, "top-right");