Skip to content

Instantly share code, notes, and snippets.

@nommuna2
nommuna2 / Readme.md
Last active October 21, 2024 19:30
(ArcGIS API for JavaScript) Add Shapefile from disk to a map in 4.x
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 20:41
(ArcGIS API for JavaScript 4.x) Sample of applying a definition expression on a feature layer using a drop-down.
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"dojo/domReady!"
],
function (Map, MapView, FeatureLayer) {
const filter = document.getElementById('state');
//Create a new map and set the basemap to Dark gray
@nommuna2
nommuna2 / Sample.js
Last active April 26, 2019 20:24
(ArcGIS API for JavaScript) Sample of adding popupTemplate to a mapservice layer in 3.x.
require(["esri/map",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/dijit/Popup",
"dojo/dom-construct",
"esri/dijit/PopupTemplate",
"dojo/domReady!"
], function (Map, ArcGISDynamicMapServiceLayer,Query, QueryTask, Popup, domCon, PopupTemplate) {
@nommuna2
nommuna2 / Sample.py
Last active April 26, 2019 20:22
(ArcGIS API for Python) Delete fields from a feature layer using the python API
import arcgis
from arcgis.gis import GIS
# Provide credentials to the GIS object.
gis = GIS(username="username", password= "password")
#Get the id of the hosted feature layer
item = gis.content.get("id of feature layer")
#Get the feature layer itself
@nommuna2
nommuna2 / Sample.py
Last active April 26, 2019 20:20
(ArcGIS API for Python) Publish a feature layer from server to AGO idea
# Sample of how to copy a feature layer from a local ArcGIS server and publish it to AGOL.
import arcgis
from arcgis import features
from arcgis import GIS
from arcgis.gis import Item
import json
gis = GIS(username="username", password= "password")
#Turn Feature Layer to a Feature Set
@nommuna2
nommuna2 / Readme.md
Last active May 17, 2019 22:16
(ArcGIS API for JavaScript) Custom GL layer for a Feature Layer