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

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

CSS

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

              
            
!

JS

              
                require([
	"esri/layers/SceneLayer",
	"esri/views/SceneView",
	"esri/Map",
	"esri/renderers/SimpleRenderer",
	"esri/symbols/MeshSymbol3D",
	"esri/symbols/FillSymbol3DLayer",
	"esri/Color",
	"esri/symbols/edges/SolidEdges3D",
	"esri/core/promiseUtils"
], function (
	SceneLayer,
	SceneView,
	Map,
	SimpleRenderer,
	MeshSymbol3D,
	FillSymbol3DLayer,
	Color,
	SolidEdges3D,
	promiseUtils
) {
	const buildings = new SceneLayer({
		opacity: 1,
		popupEnabled: false,
		renderer: new SimpleRenderer({
			symbol: new MeshSymbol3D({
				symbolLayers: [
					new FillSymbol3DLayer({
						material: {
							color: new Color([200, 200, 200]),
							colorMixMode: "replace"
						},
						edges: new SolidEdges3D({
							color: new Color([100, 100, 100, 0.5])
						})
					})
				]
			})
		}),
		url:
			"https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/SF_BLDG_WSL1/SceneServer/layers/0"
	});

	const view = new SceneView({
		container: "viewDiv",
		map: new Map({
			basemap: "gray-vector",
			ground: "world-elevation",
			layers: [buildings]
		}),
		qualityProfile: "high",
		camera: {
			position: [-122.39274277, 37.78022093, 601.67648],
			heading: 330.47,
			tilt: 64.02
		},
		highlightOptions: {
			color: new Color([255, 153, 0]),
			fillOpacity: 0.6,
			haloOpacity: 0
		}
	});

	view.when().then(async () => {
		const buildingsLV = await view.whenLayerView(buildings);
		let highlight = null;
		view.on(
			"pointer-move",
			promiseUtils.debounce(async (e) => {
				const ht = await view.hitTest(e, {
					include: [buildings]
				});
				if (highlight) {
					highlight.remove();
					highlight = null;
				}
				if (ht.results.length > 0) {
					// select the first feature (closest to the camera)
					const graphic = ht.results[0].graphic;
					if (graphic) {
						highlight = buildingsLV.highlight(graphic);
					}
				}
			})
		);
		view.on("pointer-leave", () => {
			if (highlight) {
				highlight.remove();
				highlight = null;
			}
		});
	});
});

              
            
!
999px

Console