This file contains 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
// to get layer id: | |
view.map.layers.forEach(l => console.log(l.id, l.title)) | |
// replace the id below with the one you want to modify: | |
const layer = view.map.findLayerById("189b5aed56b-layer-75"); | |
// clone renderer, modify it and set it back on the layer: | |
let renderer = layer.renderer.clone(); | |
renderer.uniqueValueInfos.forEach(info=>{ |
This file contains 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
// snow groomers | |
smoothGroomer.labelingInfo = [ | |
new LabelClass({ | |
labelExpressionInfo: { | |
expression: "$feature.name + TextFormatting.NewLine + '10.5mph'" | |
}, | |
labelPlacement: "above-center", | |
symbol: new LabelSymbol3D({ | |
symbolLayers: [ |
All these commands can be followed along using this repository:
I might not know the exact name of the branch, but I do know it contains some word
git branch --r | grep -i <pattern>
Maybe I don't have all the branches in sync with the remote repo, so I need to fetch them:
git fetch origin
This file contains 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
import pandas as pd | |
from skyfield.api import load | |
from datetime import timedelta | |
from math import isnan, pi, sqrt, atan2, sin, cos | |
from geojson import FeatureCollection, Feature, LineString, dump | |
from arcgis.gis import GIS | |
#constants | |
ts = load.timescale() | |
now = ts.now() |
This file contains 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 rotate() { | |
if (!view.interacting) { | |
view.goTo({ | |
heading: view.camera.heading + 0.1, | |
center: view.center | |
}, {animate: false}); | |
requestAnimationFrame(rotate); | |
} | |
} |
This file contains 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 rotate() { | |
if (!view.interacting) { | |
const camera = view.camera.clone(); | |
camera.position.longitude -= 0.2; | |
view.goTo(camera, { animate: false }); | |
requestAnimationFrame(rotate); | |
} | |
} | |
view.when(function () { |
This file contains 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 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 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" | |
}; | |
} | |
}); |
NewerOlder