css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              <body class="claro">
  <div id="mainWindow" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width:100%; height:100%;">
    <div id="map" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
      <div style="position:absolute; right:20px; top:10px; z-Index:999;">
        <div id="titlePane" data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Measurement', closable:'false', open:'false'">
          <div id="measurementDiv"></div>
          <span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
 body {
   height: 100%;
   width: 100%;
   margin: 0;
 body {
   background-color: #FFF;
   overflow: hidden;
   font-family: "Trebuchet MS";
 #map {
   border: solid 2px #808775;
   -moz-border-radius: 4px;
   -webkit-border-radius: 4px;
   border-radius: 4px;
   margin: 5px;
   padding: 0px;
 #titlePane {
   width: 240px;
 .claro .dijitTitlePaneTitle {
   background: #fff;
   font-weight: 600;
   border: none;
   border-bottom: solid 1px #29201A;
   border-top: solid 1px #29201A;
 .claro .dijitTitlePaneTitleHover {
   background: #eee;
 .claro .dijitTitlePaneTitleActive {
   background: #808775;
 .claro .dijitTitlePaneContentOuter {
   border-right: none;
   border-bottom: none;
   border-left: none;
              define("custom.Measurement", ["dojo/_base/declare", "dojo/_base/lang", "esri/dijit/Measurement", "dojo/query", "dojo/on", "dojo/dom-construct"], function(declare, lang, Measurement, dojoQuery, dojoOn, domConstruct) {
  return declare([Measurement], {
    postCreate: function() {
      if (this.map && this.map.infoWindow) {
        var node = domConstruct.create("a", {
          innerHTML: "Measure me",
          href: "javascript:void(0);"
        }, dojoQuery(".actionList", this.map.infoWindow.domNode)[0]);
        dojoOn(node, "click", lang.hitch(this, this._calculateGraphicItem));

    _calculateGraphicItem: function(evt) {
      var graphic = this.map.infoWindow.getSelectedFeature();
      if (graphic && graphic.geometry) {

], function(
  dom, Color, keys, parser,
  esriConfig, has, Map, SnappingManager, Measurement, FeatureLayer, SimpleRenderer, GeometryService, SimpleLineSymbol, SimpleFillSymbol, InfoTemplate
) {
  //This sample may require a proxy page to handle communications with the ArcGIS Server services. You will need to  
  //replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic 
  //for details on setting up a proxy page.
  esriConfig.defaults.io.proxyUrl = "/proxy/";
  esriConfig.defaults.io.alwaysUseProxy = false;

  //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
  esriConfig.defaults.geometryService = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

  map = new Map("map", {
    basemap: "satellite",
    center: [-85.743, 38.256],
    zoom: 17

  var sfs = new SimpleFillSymbol(
    new SimpleLineSymbol("solid", new Color([195, 176, 23]), 2),

  var parcelsLayer = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0", {
    mode: FeatureLayer.MODE_ONDEMAND,
    outFields: ["*"]
  parcelsLayer.setRenderer(new SimpleRenderer(sfs));
  parcelsLayer.setInfoTemplate(new InfoTemplate("Parcels", "${*}"));

  //dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac., but has wrong code for Chrome on Mac
  var snapManager = map.enableSnapping({
    snapKey: has("mac") ? keys.META : keys.CTRL
  var layerInfos = [{
    layer: parcelsLayer

  var measurement = new Measurement({
    map: map
  }, dom.byId("measurementDiv"));
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................