Skip to content

Instantly share code, notes, and snippets.

View RalucaNicola's full-sized avatar
🌍

Raluca Nicola RalucaNicola

🌍
View GitHub Profile
function fetchTile(level, row, col) {
return this._elevation.fetchTile(level, row, col).then(
function(data) {
for (let i = 0; i < data.values.length; i++) {
if (data.values[i] >= 0) {
data.values[i] = data.values[i] * 60;
}
else {
data.values[i] = data.values[i] * 40;
}
@RalucaNicola
RalucaNicola / custom-basemap.js
Created August 16, 2019 11:10
Custom basemap
const basemap = new Basemap({
baseLayers: [
new TileLayer({
url: "https://tiles.arcgis.com/tiles/nGt4QxSblgDfeJn9/arcgis/rest/services/terrain_with_heavy_bathymetry/MapServer"
})
]
});
const map = new Map({
basemap: basemap
#viewDiv canvas {
filter: drop-shadow(0px 0px 5px rgb(86, 72, 31));
}
const webscene = new WebScene({
ground: {
opacity: 0 // set transparent ground
}
});
const view = new SceneView({
container: "viewDiv",
map: webscene,
qualityProfile: "high",
const view = require("esri/views/View").views.getItemAt(0);
(function() {
const p = view.camera.position;
if (p.spatialReference.isWebMercator || p.spatialReference.isWGS84) {
console.log(`
{
position: [
${p.longitude.toFixed(8)},
${p.latitude.toFixed(8)},
const hillsLayer = new FeatureLayer({
url: "https://services2.arcgis.com/cFEFS0EWrhfDeVw9/arcgis/rest/services/HillsZurichDemo/FeatureServer",
elevationInfo: {
mode: "absolute-height",
featureExpressionInfo: {
expression: "Pow(Geometry($feature).Z, 1.2)"
}
},
renderer: {
type: "simple",
const renderer = {
type: "simple",
symbol: {
type: "polygon-3d",
symbolLayers: [{
type: "extrude",
material: {
color: [86, 72, 31]
},
size: 100
const contourLayer = new FeatureLayer({
url: "https://services2.arcgis.com/cFEFS0EWrhfDeVw9/arcgis/rest/services/ContourLinesZurichDemo/FeatureServer",
elevationInfo: {
mode: "absolute-height",
featureExpressionInfo: {
expression: "Pow($feature.elevation,1.2)"
}
},
renderer: {
type: "simple",
@RalucaNicola
RalucaNicola / data-ideas.md
Last active June 30, 2019 11:04
Data collection

How do I search for data?

@RalucaNicola
RalucaNicola / halo-sv.md
Last active June 27, 2019 09:34
Change halo in SceneViewer
  1. Get the index of the layer you want to modify. To do that, run this snippet in the console:
view.map.allLayers.forEach(function(layer, index) {
  console.log(layer.title, "->", index);
});
  1. Set the halo color, transparency and size by running the changeHalo function in the console.