Skip to content

Instantly share code, notes, and snippets.

@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 22:06
(ArcGIS API for JavaScript) Sample of using promises and the goTo method
require([
"esri/Map",
"esri/views/SceneView",
"esri/layers/FeatureLayer",
"dojo/domReady!"
],
function (Map, SceneView, FeatureLayer) {
// Code to create the map and view will go here
var featureLayer = new FeatureLayer({
@nommuna2
nommuna2 / Sample1.js
Last active April 26, 2019 22:05
(ArcGIS API for JavaScript) Creating a feature set and making a new feature layer with extra query parameters
//Version using featurelayer query
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/tasks/support/Query",
"esri/tasks/QueryTask",
"dojo/domReady!"
],
function (Map, MapView, FeatureLayer, Query, QueryTask, SimpleFillSymbol, Renderer) {
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 22:04
(ArcGIS API for JavaScript) Sample of simplifying polygons using 4.x
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/tasks/support/Query",
"esri/tasks/QueryTask",
"esri/geometry/geometryEngineAsync",
"dojo/domReady!"
],
function (Map, MapView, FeatureLayer, Query, QueryTask, geometryEngineAsync) {
@nommuna2
nommuna2 / Sample.cs
Last active April 26, 2019 22:03
(ArcGIS Runtime SDK for .NET) Sample of adding layer to the map and doing a query
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@nommuna2
nommuna2 / Sample.cs
Last active April 26, 2019 22:02
(ArcGIS Runtime SDK for .NET) Practice of the .NET API. Buffering and using geometry engine
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 21:58
(ArcGIS API for JavaScript) Break Renderer/Query in 3.x
require(["esri/map",
"esri/layers/FeatureLayer",
"esri/tasks/query",
"esri/renderers/ClassBreaksRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/Color",
"dojo/domReady!"],
function (Map, FeatureLayer, Query, ClassBreaksRenderer, SimpleMarkerSymbol, Color) {
var featureLayer = new FeatureLayer("url to feature layer", {
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 21:56
(ArcGIS API for JavaScript) Geometry Engine (cut and buffer)
//This example is using the geometry engine to buffer around a line and use the cut method to get two half's
require([
"esri/Map",
"esri/views/MapView",
"esri/geometry/Polyline",
"esri/geometry/geometryEngine",
"esri/symbols/SimpleLineSymbol",
"esri/Graphic",
"esri/symbols/SimpleFillSymbol",
"dojo/domReady!"
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 21:56
(ArcGIS API for JavaScript) Extrusion 3D and Unique Renderer
require([
"esri/Map",
"esri/views/SceneView",
"esri/layers/FeatureLayer",
"esri/symbols/PolygonSymbol3D",
"esri/symbols/ExtrudeSymbol3DLayer",
"esri/renderers/SimpleRenderer",
"esri/renderers/UniqueValueRenderer",
"dojo/domReady!"
],
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 21:54
(ArcGIS API for JavaScript) Sample of passing a feature set to a GPService (Event driven)
require(["esri/map",
"esri/layers/FeatureLayer",
"esri/tasks/QueryTask",
"esri/tasks/query",
"esri/tasks/Geoprocessor",
"dojo/domReady!"
], function (Map, FeatureLayer, QueryTask, Query, Geoprocessor) {
//Initializing the map constructor
var map = new Map("map", {
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 21:49
(ArcGIS API for JavaScript) Sample of selecting the nearest street using buffer in 3.x
require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color",
"esri/tasks/query",
"esri/geometry/geometryEngine",
"esri/graphic",