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.


  <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 layers-scenelayer-edges sample, read the original sample description at developers.arcgis.com.
<title>Add edges to a SceneLayer - 4.7</title>
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;

    #controls {
      padding: 10px;
      background-color: rgba(255, 255, 255, 0.9);
  <link rel="stylesheet" href="https://js.arcgis.com/4.7/esri/css/main.css">
  <script src="https://js.arcgis.com/4.7/"></script>

    ], function(WebScene, SceneView, SceneLayer, Legend, SpatialReference, Polygon, Graphic) {

      var solidEdges = {
        type: "solid",
        color: [0, 0, 0, 0.6],
        size: 1

      var sketchEdges = {
        type: "sketch",
        color: [0, 0, 0, 0.4],
        size: 1.2,
        extensionLength: 6

      // Create the renderer and configure visual variables
      var renderer = {
        type: "simple", // autocasts as new SimpleRenderer()
        symbol: {
          type: "mesh-3d",
          symbolLayers: [{
            type: "fill",
            material: {
              color: "#ffffff",
              colorMixMode: "replace"
            edges: solidEdges
        visualVariables: [{
          // specifies a visual variable of continuous color
          type: "color",
          // based on a field indicating the walking time to public transport
          field: "walkTimeToStopsInService",
          legendOptions: {
            title: "Walking time to public transport"
          // color ramp from white to blue
          // based on the walking time to public transport.
          // Buildings will be assigned a color proportional
          // to the min and max colors specified below
          stops: [{
            value: 1,
            color: "#2887a1",
            label: "less than 1 minute"
            value: 15,
            color: "#ffffff",
            label: "more than 15 minutes"

      var sceneLayer = new SceneLayer({
        portalItem: {
          id: "f5c497819a374941b0ce8d9b0e979819"
        title: "San Francisco buildings",
        renderer: renderer // Set the renderer to sceneLayer

      var webscene = new WebScene({
        portalItem: {
          id: "12d629fc946845628011f17a963373a9"
        layers: [sceneLayer]

      var view = new SceneView({
        container: "viewDiv",
        map: webscene
      view.on('click', function(evt) {
      var polygon = new Polygon({
        rings: [[
          [-13624655.214694504, 4549133.774524677],
-13624767.594677897, 4549280.788381278],
          [-13624655.214694504, 4549133.774524677]
        spatialReference: SpatialReference.WebMercator
      var polygonSymbol = {
          type: "simple-fill", // autocasts as new SimpleFillSymbol()
          color: [227, 139, 79, 0.8],
          outline: { // autocasts as new SimpleLineSymbol()
            color: [255, 255, 255],
            width: 1

      var graphic = new Graphic({
        geometry: polygon,
        symbol: polygonSymbol

      var query = sceneLayer.createQuery();
      query.geometry = polygon;
      query.spatialRelationship = 'intersects';
      query.inSpatialReference = SpatialReference.WebMercator;
      query.outSpatialReference = SpatialReference.WebMercator;


  <div id="viewDiv"></div>

🕑 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 ..................