This sample is a modified 4.x version from the 3.x version linked here (https://developers.arcgis.com/javascript/3/jssamples/portal_addshapefile.html).
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
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 |
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
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) { |
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
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 |
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
# 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 |
This modified sample is from the Custom WebGL layer (https://developers.arcgis.com/javascript/latest/sample-code/custom-gl-visuals/index.html#).
To make this work for a feature layer, I did the following....
- Created a feature layer class
OlderNewer