<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Posting feature layer on to a database in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/posting-feature-layer-on-to-a-database/m-p/1040570#M72191</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;We are currently doing our bachelor project and are trying to save our feature layer for later use. What is the best way for doing that? Currently, we have created 2 feature layer that we load into our application through ArcGIS services we then create a local feature layer from the 2 feature layer. We then want to save our newly made feature layer for later use. Can you post feature layers to a database? Here is how far we have come:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;ArcGIS API for JavaScript Tutorials: Query a feature layer (spatial)&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;html, body, #viewDiv {&lt;BR /&gt;padding: 0;&lt;BR /&gt;margin: 0;&lt;BR /&gt;height: 100%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#layerToggle {&lt;BR /&gt;top: 120px;&lt;BR /&gt;right: 20px;&lt;BR /&gt;position: absolute;&lt;BR /&gt;z-index: 99;&lt;BR /&gt;background-color: white;&lt;BR /&gt;border-radius: 8px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: black;&lt;BR /&gt;padding: 10px;&lt;BR /&gt;opacity: 1;&lt;BR /&gt;}&lt;BR /&gt;#layerToggle1 {&lt;BR /&gt;top: 60px;&lt;BR /&gt;right: 20px;&lt;BR /&gt;position: absolute;&lt;BR /&gt;z-index: 99;&lt;BR /&gt;background-color: white;&lt;BR /&gt;border-radius: 8px;&lt;BR /&gt;border-width: 2px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: black;&lt;BR /&gt;padding: 10px;&lt;BR /&gt;opacity: 1;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/4.18/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.18/esri/themes/light/main.css&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://community.esri.com/" target="_blank"&gt;https://js.arcgis.com/4.18/"&amp;gt;&amp;lt;/script&lt;/A&gt;&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;/P&gt;&lt;P&gt;"esri/config",&lt;BR /&gt;"esri/Map",&lt;BR /&gt;"esri/views/MapView",&lt;/P&gt;&lt;P&gt;"esri/widgets/Sketch",&lt;BR /&gt;"esri/layers/GraphicsLayer",&lt;BR /&gt;"esri/layers/FeatureLayer",&lt;BR /&gt;"esri/Graphic",&lt;BR /&gt;"esri/widgets/Search",&lt;BR /&gt;"esri/renderers/ClassBreaksRenderer",&lt;BR /&gt;"esri/widgets/Legend","esri/views/SceneView",&lt;/P&gt;&lt;P&gt;], function(esriConfig,Map, MapView, Sketch, GraphicsLayer, FeatureLayer,Graphic,Search,ClassBreaksRenderer,Legend) {&lt;/P&gt;&lt;P&gt;esriConfig.apiKey = "AAPKac92afe710ec4db9bf8423343102b147tLzn_6tk50TFgDBNl63Tr-44V9blp4Njp8ffo7faiUeI0K_9qJpyVRV2xLm6y2Zc";&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;basemap: "arcgis-topographic" //Basemap layer service&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// the layer that we want to save for later use&lt;BR /&gt;var layer;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [ 15.4660405, 58.41607], //Longitude, latitude&lt;BR /&gt;zoom: 13&lt;BR /&gt;});&lt;BR /&gt;var searchWidget = new Search({&lt;BR /&gt;view: view&lt;BR /&gt;});&lt;BR /&gt;// Add the search widget to the top right corner of the view&lt;BR /&gt;view.ui.add(searchWidget, {&lt;BR /&gt;position: "top-left"&lt;BR /&gt;});&lt;BR /&gt;var renderer = new ClassBreaksRenderer({&lt;BR /&gt;type: "class-breaks",&lt;BR /&gt;// attribute of interest - Earthquake magnitude&lt;BR /&gt;field: "AREAL"&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 0,&lt;BR /&gt;maxValue: 10.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 255, 128, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 10,&lt;BR /&gt;maxValue: 20.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 5, 128, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 20,&lt;BR /&gt;maxValue: 100.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 55, 28, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const jordblock = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/BlockKarta/FeatureServer/0" target="_blank"&gt;https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/BlockKarta/FeatureServer/0&lt;/A&gt;",&lt;BR /&gt;renderer: renderer,&lt;BR /&gt;outFields: ["BLOCKID","REGION","KATEGORI","AREAL","AGOSLAG"],&lt;BR /&gt;visible: false,&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;map.add(jordblock);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Create a symbol for rendering the graphic&lt;BR /&gt;var fillSymbol1 = {&lt;BR /&gt;type: "simple-fill",&lt;BR /&gt;size: "8px",// autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [27, 39, 79, 0.8],&lt;BR /&gt;outline: {&lt;BR /&gt;// autocasts as new SimpleLineSymbol()&lt;BR /&gt;color: [255, 255, 255],&lt;BR /&gt;width: 1&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var selectionLayer = new GraphicsLayer();&lt;BR /&gt;view.on("click", function(e){&lt;BR /&gt;view.hitTest(e.screenPoint).then(function(response){&lt;BR /&gt;selectionLayer.graphics.removeAll();&lt;BR /&gt;response.results.forEach(function(g){&lt;BR /&gt;var graphic = g.graphic;&lt;BR /&gt;if(g.graphic){&lt;/P&gt;&lt;P&gt;queryFeaturelayer( g.graphic.geometry);&lt;BR /&gt;graphic.symbol = fillSymbol1;&lt;BR /&gt;selectionLayer.graphics.add(graphic);&lt;BR /&gt;map.add(selectionLayer);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Reference query layer&lt;BR /&gt;const parcelLayer = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/Lerkarta/FeatureServer/0" target="_blank"&gt;https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/Lerkarta/FeatureServer/0&lt;/A&gt;",&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;function queryFeaturelayer(geometry) {&lt;/P&gt;&lt;P&gt;const parcelQuery = {&lt;BR /&gt;spatialRelationship: "intersects", // Relationship operation to apply&lt;BR /&gt;geometry: geometry,&lt;BR /&gt;outFields: ["DN"],// The sketch feature geometry&lt;BR /&gt;// Attributes to return&lt;BR /&gt;returnGeometry: true&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;parcelLayer.queryFeatures(parcelQuery)&lt;BR /&gt;.then((results) =&amp;gt; {&lt;BR /&gt;displayResults(results);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}).catch((error) =&amp;gt; {&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// Show features (graphics)&lt;BR /&gt;function displayResults(results) {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const defaultSym = {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;outline: {&lt;BR /&gt;// autocasts as new SimpleLineSymbol()&lt;BR /&gt;color: [128, 128, 128, 0.2],&lt;BR /&gt;width: "0.5px"&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;var renderer2 = {&lt;BR /&gt;type: "simple", // autocasts as new SimpleRenderer()&lt;BR /&gt;symbol: defaultSym, // the default symbol defined in step 1&lt;BR /&gt;legendOptions: {&lt;BR /&gt;title: "% population in poverty by county"&lt;BR /&gt;},// label for the legend&lt;BR /&gt;visualVariables: [&lt;BR /&gt;{&lt;BR /&gt;type: "color", // indicates this is a color visual variable&lt;BR /&gt;field: "DN", // total population in poverty&lt;BR /&gt;stops: [&lt;BR /&gt;{&lt;BR /&gt;value: 0, // features where &amp;lt; 10% of the pop in poverty&lt;BR /&gt;color: "#00FF00", // will be assigned this color (beige)&lt;BR /&gt;label: "Lerhalt 0" // label to display in the legend&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;value: 30, // features where &amp;lt; 10% of the pop in poverty&lt;BR /&gt;color: "#FFFF00", // will be assigned this color (beige)&lt;BR /&gt;label: "Lerhalt 30" // label to display in the legend&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;value: 60, // features where &amp;gt; 30% of the pop in poverty&lt;BR /&gt;color: "#FF0000", // will be assigned this color (purple)&lt;BR /&gt;label: "Lerhalt 60" // label to display in the legend&lt;BR /&gt;}&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;// features with values between 0.1 - 0.3 will be assigned&lt;BR /&gt;// a color on a ramp between beige and purple proportional&lt;BR /&gt;// to where the value falls between 0.1 and 0.3&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;};&lt;BR /&gt;layer = new FeatureLayer({&lt;BR /&gt;source: results.features,&lt;BR /&gt;objectIdField: "OBJECTID",&lt;BR /&gt;fields: [{&lt;BR /&gt;name: "OBJECTID",&lt;BR /&gt;type: "oid"&lt;BR /&gt;}, {&lt;BR /&gt;name: "DN",&lt;BR /&gt;type: "double"&lt;BR /&gt;}],&lt;BR /&gt;visible: false,// array of graphics objects&lt;BR /&gt;renderer: renderer2&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;var lerblockToggle = document.getElementById("layerToggle");&lt;/P&gt;&lt;P&gt;// Listen to the change event for the checkbox&lt;BR /&gt;lerblockToggle.addEventListener("click", function() {&lt;BR /&gt;map.add(layer);&lt;BR /&gt;layer.visible = true;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//lerblock.setSelectionSymbol(fillSymbol1);&lt;BR /&gt;var jordblockToggle = document.getElementById("jordblock");&lt;/P&gt;&lt;P&gt;// Listen to the change event for the checkbox&lt;BR /&gt;jordblockToggle.addEventListener("change", function() {&lt;BR /&gt;// When the checkbox is checked (true), set the layer's visibility to true&lt;BR /&gt;jordblock.visible = jordblockToggle.checked;&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv2"&amp;gt; &amp;lt;span id="layerToggle1" class="esri-widget"&amp;gt; &amp;lt;input type="checkbox" id="jordblock" /&amp;gt;Visa block&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt; &amp;lt;button id="layerToggle" class="esri-widget" &amp;gt; Visa lerblock&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 13:10:54 GMT</pubDate>
    <dc:creator>WilliamHepp</dc:creator>
    <dc:date>2021-03-25T13:10:54Z</dc:date>
    <item>
      <title>Posting feature layer on to a database</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/posting-feature-layer-on-to-a-database/m-p/1040570#M72191</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;We are currently doing our bachelor project and are trying to save our feature layer for later use. What is the best way for doing that? Currently, we have created 2 feature layer that we load into our application through ArcGIS services we then create a local feature layer from the 2 feature layer. We then want to save our newly made feature layer for later use. Can you post feature layers to a database? Here is how far we have come:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;ArcGIS API for JavaScript Tutorials: Query a feature layer (spatial)&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;html, body, #viewDiv {&lt;BR /&gt;padding: 0;&lt;BR /&gt;margin: 0;&lt;BR /&gt;height: 100%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#layerToggle {&lt;BR /&gt;top: 120px;&lt;BR /&gt;right: 20px;&lt;BR /&gt;position: absolute;&lt;BR /&gt;z-index: 99;&lt;BR /&gt;background-color: white;&lt;BR /&gt;border-radius: 8px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: black;&lt;BR /&gt;padding: 10px;&lt;BR /&gt;opacity: 1;&lt;BR /&gt;}&lt;BR /&gt;#layerToggle1 {&lt;BR /&gt;top: 60px;&lt;BR /&gt;right: 20px;&lt;BR /&gt;position: absolute;&lt;BR /&gt;z-index: 99;&lt;BR /&gt;background-color: white;&lt;BR /&gt;border-radius: 8px;&lt;BR /&gt;border-width: 2px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: black;&lt;BR /&gt;padding: 10px;&lt;BR /&gt;opacity: 1;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/4.18/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.18/esri/themes/light/main.css&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://community.esri.com/" target="_blank"&gt;https://js.arcgis.com/4.18/"&amp;gt;&amp;lt;/script&lt;/A&gt;&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;/P&gt;&lt;P&gt;"esri/config",&lt;BR /&gt;"esri/Map",&lt;BR /&gt;"esri/views/MapView",&lt;/P&gt;&lt;P&gt;"esri/widgets/Sketch",&lt;BR /&gt;"esri/layers/GraphicsLayer",&lt;BR /&gt;"esri/layers/FeatureLayer",&lt;BR /&gt;"esri/Graphic",&lt;BR /&gt;"esri/widgets/Search",&lt;BR /&gt;"esri/renderers/ClassBreaksRenderer",&lt;BR /&gt;"esri/widgets/Legend","esri/views/SceneView",&lt;/P&gt;&lt;P&gt;], function(esriConfig,Map, MapView, Sketch, GraphicsLayer, FeatureLayer,Graphic,Search,ClassBreaksRenderer,Legend) {&lt;/P&gt;&lt;P&gt;esriConfig.apiKey = "AAPKac92afe710ec4db9bf8423343102b147tLzn_6tk50TFgDBNl63Tr-44V9blp4Njp8ffo7faiUeI0K_9qJpyVRV2xLm6y2Zc";&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;basemap: "arcgis-topographic" //Basemap layer service&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// the layer that we want to save for later use&lt;BR /&gt;var layer;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [ 15.4660405, 58.41607], //Longitude, latitude&lt;BR /&gt;zoom: 13&lt;BR /&gt;});&lt;BR /&gt;var searchWidget = new Search({&lt;BR /&gt;view: view&lt;BR /&gt;});&lt;BR /&gt;// Add the search widget to the top right corner of the view&lt;BR /&gt;view.ui.add(searchWidget, {&lt;BR /&gt;position: "top-left"&lt;BR /&gt;});&lt;BR /&gt;var renderer = new ClassBreaksRenderer({&lt;BR /&gt;type: "class-breaks",&lt;BR /&gt;// attribute of interest - Earthquake magnitude&lt;BR /&gt;field: "AREAL"&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 0,&lt;BR /&gt;maxValue: 10.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 255, 128, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 10,&lt;BR /&gt;maxValue: 20.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 5, 128, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;renderer.addClassBreakInfo({&lt;BR /&gt;minValue: 20,&lt;BR /&gt;maxValue: 100.0,&lt;BR /&gt;symbol: {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [ 55, 28, 0, 0.4 ],&lt;BR /&gt;outline: {&lt;BR /&gt;width: 0.2,&lt;BR /&gt;color: [255, 5, 5, 0.5]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const jordblock = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/BlockKarta/FeatureServer/0" target="_blank"&gt;https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/BlockKarta/FeatureServer/0&lt;/A&gt;",&lt;BR /&gt;renderer: renderer,&lt;BR /&gt;outFields: ["BLOCKID","REGION","KATEGORI","AREAL","AGOSLAG"],&lt;BR /&gt;visible: false,&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;map.add(jordblock);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Create a symbol for rendering the graphic&lt;BR /&gt;var fillSymbol1 = {&lt;BR /&gt;type: "simple-fill",&lt;BR /&gt;size: "8px",// autocasts as new SimpleFillSymbol()&lt;BR /&gt;color: [27, 39, 79, 0.8],&lt;BR /&gt;outline: {&lt;BR /&gt;// autocasts as new SimpleLineSymbol()&lt;BR /&gt;color: [255, 255, 255],&lt;BR /&gt;width: 1&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var selectionLayer = new GraphicsLayer();&lt;BR /&gt;view.on("click", function(e){&lt;BR /&gt;view.hitTest(e.screenPoint).then(function(response){&lt;BR /&gt;selectionLayer.graphics.removeAll();&lt;BR /&gt;response.results.forEach(function(g){&lt;BR /&gt;var graphic = g.graphic;&lt;BR /&gt;if(g.graphic){&lt;/P&gt;&lt;P&gt;queryFeaturelayer( g.graphic.geometry);&lt;BR /&gt;graphic.symbol = fillSymbol1;&lt;BR /&gt;selectionLayer.graphics.add(graphic);&lt;BR /&gt;map.add(selectionLayer);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Reference query layer&lt;BR /&gt;const parcelLayer = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/Lerkarta/FeatureServer/0" target="_blank"&gt;https://services3.arcgis.com/CRqjw6FC9fpbCgMy/ArcGIS/rest/services/Lerkarta/FeatureServer/0&lt;/A&gt;",&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;function queryFeaturelayer(geometry) {&lt;/P&gt;&lt;P&gt;const parcelQuery = {&lt;BR /&gt;spatialRelationship: "intersects", // Relationship operation to apply&lt;BR /&gt;geometry: geometry,&lt;BR /&gt;outFields: ["DN"],// The sketch feature geometry&lt;BR /&gt;// Attributes to return&lt;BR /&gt;returnGeometry: true&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;parcelLayer.queryFeatures(parcelQuery)&lt;BR /&gt;.then((results) =&amp;gt; {&lt;BR /&gt;displayResults(results);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}).catch((error) =&amp;gt; {&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// Show features (graphics)&lt;BR /&gt;function displayResults(results) {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const defaultSym = {&lt;BR /&gt;type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt;outline: {&lt;BR /&gt;// autocasts as new SimpleLineSymbol()&lt;BR /&gt;color: [128, 128, 128, 0.2],&lt;BR /&gt;width: "0.5px"&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;var renderer2 = {&lt;BR /&gt;type: "simple", // autocasts as new SimpleRenderer()&lt;BR /&gt;symbol: defaultSym, // the default symbol defined in step 1&lt;BR /&gt;legendOptions: {&lt;BR /&gt;title: "% population in poverty by county"&lt;BR /&gt;},// label for the legend&lt;BR /&gt;visualVariables: [&lt;BR /&gt;{&lt;BR /&gt;type: "color", // indicates this is a color visual variable&lt;BR /&gt;field: "DN", // total population in poverty&lt;BR /&gt;stops: [&lt;BR /&gt;{&lt;BR /&gt;value: 0, // features where &amp;lt; 10% of the pop in poverty&lt;BR /&gt;color: "#00FF00", // will be assigned this color (beige)&lt;BR /&gt;label: "Lerhalt 0" // label to display in the legend&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;value: 30, // features where &amp;lt; 10% of the pop in poverty&lt;BR /&gt;color: "#FFFF00", // will be assigned this color (beige)&lt;BR /&gt;label: "Lerhalt 30" // label to display in the legend&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;value: 60, // features where &amp;gt; 30% of the pop in poverty&lt;BR /&gt;color: "#FF0000", // will be assigned this color (purple)&lt;BR /&gt;label: "Lerhalt 60" // label to display in the legend&lt;BR /&gt;}&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;// features with values between 0.1 - 0.3 will be assigned&lt;BR /&gt;// a color on a ramp between beige and purple proportional&lt;BR /&gt;// to where the value falls between 0.1 and 0.3&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;};&lt;BR /&gt;layer = new FeatureLayer({&lt;BR /&gt;source: results.features,&lt;BR /&gt;objectIdField: "OBJECTID",&lt;BR /&gt;fields: [{&lt;BR /&gt;name: "OBJECTID",&lt;BR /&gt;type: "oid"&lt;BR /&gt;}, {&lt;BR /&gt;name: "DN",&lt;BR /&gt;type: "double"&lt;BR /&gt;}],&lt;BR /&gt;visible: false,// array of graphics objects&lt;BR /&gt;renderer: renderer2&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;var lerblockToggle = document.getElementById("layerToggle");&lt;/P&gt;&lt;P&gt;// Listen to the change event for the checkbox&lt;BR /&gt;lerblockToggle.addEventListener("click", function() {&lt;BR /&gt;map.add(layer);&lt;BR /&gt;layer.visible = true;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//lerblock.setSelectionSymbol(fillSymbol1);&lt;BR /&gt;var jordblockToggle = document.getElementById("jordblock");&lt;/P&gt;&lt;P&gt;// Listen to the change event for the checkbox&lt;BR /&gt;jordblockToggle.addEventListener("change", function() {&lt;BR /&gt;// When the checkbox is checked (true), set the layer's visibility to true&lt;BR /&gt;jordblock.visible = jordblockToggle.checked;&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv2"&amp;gt; &amp;lt;span id="layerToggle1" class="esri-widget"&amp;gt; &amp;lt;input type="checkbox" id="jordblock" /&amp;gt;Visa block&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt; &amp;lt;button id="layerToggle" class="esri-widget" &amp;gt; Visa lerblock&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 13:10:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/posting-feature-layer-on-to-a-database/m-p/1040570#M72191</guid>
      <dc:creator>WilliamHepp</dc:creator>
      <dc:date>2021-03-25T13:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Posting feature layer on to a database</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/posting-feature-layer-on-to-a-database/m-p/1040676#M72200</link>
      <description>&lt;P&gt;Not sure what you are trying to do when you say 'post feature layers to database'.&amp;nbsp; You can edit the existing layers (if you have edit access) by using the Editor widget (&lt;A title="Editor widget" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html" target="_blank" rel="noopener"&gt;Editor&lt;/A&gt;&amp;nbsp;), or create a new online layer to add data to (by editing) (&lt;A title="Create featurelayer" href="https://developers.arcgis.com/documentation/mapping-apis-and-location-services/data/tutorials/tools/create-a-new-feature-layer/" target="_blank" rel="noopener"&gt;Create&lt;/A&gt;&amp;nbsp;), or export the ArcGIS Online layer by using the Export option (&lt;A title="Export featurelayer" href="https://developers.arcgis.com/rest/users-groups-and-items/export-item.htm" target="_blank" rel="noopener"&gt;Export&lt;/A&gt;&amp;nbsp;).&amp;nbsp; I'm currently trying to work through an Export operation to get to an Excel spreadsheet of the data, but you could export to a Shapefile or File Geodatabase format as well.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 16:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/posting-feature-layer-on-to-a-database/m-p/1040676#M72200</guid>
      <dc:creator>JeffreyWilkerson</dc:creator>
      <dc:date>2021-03-25T16:59:50Z</dc:date>
    </item>
  </channel>
</rss>

