This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| const view = require("esri/views/View").views.getItemAt(0); | |
| const p = view.camera.position; | |
| if (p.spatialReference.isWebMercator || p.spatialReference.isWGS84) { | |
| console.log(` | |
| { | |
| position: [ | |
| ${p.longitude.toFixed(8)}, | |
| ${p.latitude.toFixed(8)}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const view = new SceneView({ | |
| container: "viewDiv", | |
| map: map, | |
| camera: { | |
| heading: 90, // face due east | |
| tilt: 45, // looking from a bird's eye view | |
| position: { | |
| latitude: 38, | |
| longitude: -122, | |
| z: 20000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sketchViewModel.on("create", function (event) { | |
| if (event.state === "complete") { | |
| const geometry = event.graphic.geometry; | |
| buildingLayerView.filter = { | |
| geometry: geometry, | |
| spatialRelationship: "contains" | |
| }; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sketchLayer = new GraphicsLayer({ | |
| elevationInfo: { | |
| mode: "on-the-ground" | |
| } | |
| }); | |
| webscene.add(sketchLayer); | |
| const sketchViewModel = new SketchViewModel({ | |
| layer: sketchLayer, | |
| view: view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const start = new Date(1900, 0, 1); | |
| const end = new Date(2020, 0, 1); | |
| const timeSlider = new TimeSlider({ | |
| container: "timeContainer", | |
| mode: "cumulative-from-start", | |
| fullTimeExtent: { | |
| start: start, | |
| end: end | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| esriConfig.portalUrl = "http://jsapi.maps.arcgis.com/"; | |
| const scene = new WebScene({ | |
| portalItem: { | |
| id: "2e38f798f3124f2dae84217839cc43dc" | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| font-family: Arial, Helvetica, sans-serif; | |
| color: #444; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| font: 10px sans-serif; | |
| } | |
| #g1 { | |
| color: #e83a66; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| renderer.visualVariables = [ | |
| new OpacityVariable({ | |
| valueExpression: "$feature.pred_percent", | |
| stops: [ | |
| { value: 40, opacity: 0.3, label: "< 40%" }, | |
| { value: 70, opacity: 1.0, label: "> 70%" } | |
| ] | |
| }), | |
| new SizeVariable({ | |
| valueExpression: "$feature.pred_absolute", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| partyCodes = [{ | |
| name: "PSD", | |
| field: "g1", | |
| color: "rgb(253, 127, 111)" | |
| }, { | |
| name: "USR PLUS", | |
| field: "g2", | |
| color: "rgb(0, 169, 230)" | |
| }, { | |
| name: "UDMR", |