<?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 Re: Want to Keep Feature Layer Invisible, but Graphic Layer Visible,  It disappears when FL is set to Visible: False in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398436#M36693</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure graphic/feature only exists in one layer. &amp;nbsp;If you want to 'move' it to a different layer you should first clone it, and you can use the toJson() method to help in this task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; newGraphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Graphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;oldGraphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toJson&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Dec 2016 17:18:19 GMT</pubDate>
    <dc:creator>JohnGrayson</dc:creator>
    <dc:date>2016-12-02T17:18:19Z</dc:date>
    <item>
      <title>Want to Keep Feature Layer Invisible, but Graphic Layer Visible,  It disappears when FL is set to Visible: False</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398435#M36692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning. &amp;nbsp;I have a working app, but I have running into an issue with the graphics. &amp;nbsp;I have the app set up, where the user can make a number of picks (draw points) on the map until they are ready to submit (&lt;STRONG&gt;applyEdits)&lt;/STRONG&gt; to the feature layer. &amp;nbsp;Right now, I use the standard map graphics layer and clear the graphic each time the user makes a click on the map. &amp;nbsp;I do not want to display the graphic each time the user makes a pick, only have it display as they make an individual pick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for the tricky part. &amp;nbsp;After the user makes their final pick and decides to submit, I want the graphics&amp;nbsp;to remain on the map until the application closes. &amp;nbsp;To do this, I have set up a Graphics layer, &amp;nbsp;The problem is, when I pass in the geometry (feature), the graphic displays as I want, but only if the Feature Layer is set to &lt;STRONG&gt;Visible: True&lt;/STRONG&gt;. &amp;nbsp;I need the Feature Layer to remain &lt;STRONG&gt;Visible: False&lt;/STRONG&gt;, since the data will be sensitive to the Public. &amp;nbsp; When the Feature Layer is set to &amp;nbsp;&lt;STRONG&gt;Visible: False,&amp;nbsp;&lt;/STRONG&gt;The graphics layers becomes hidden as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in short, how can I have the feature layer where the visibility is set to false, yet have the Graphics layer display?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are samples of my work flow and some code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Drawing the Point and submitting after 3 picks (the third pick is the point I want to submit)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Buttons used to perform draw and submit&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="274722" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/274722_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performing a Draw using the Draw Hot Spot 1. &amp;nbsp;On the third pick, I want to submit. &amp;nbsp;The graphic is cleared as I want. &amp;nbsp;Notice how the graphic disappears each time it is re-drawn. &amp;nbsp;I want this to occur by design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick 1&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="274724" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/274724_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;Pick 2&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.esri.com/legacyfs/online/274850_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Pick 3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/274851_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When hitting the Submit Hot Spot Button, it posts to the feature layer with an alert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when going to Draw Hot Spot 2, notice how a new graphic is drawn, but the blue pushpin disappears. &amp;nbsp;This is what I do not want.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="274731" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/274731_pastedImage_11.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Graphics Layer:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Symbols - Picture Marker Symbols&lt;BR /&gt;&lt;SPAN&gt; symbol1 = new PictureMarkerSymbol('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fgis.edmondok.com%2Ftfstudy%2Fgraphics%2Fpushpin_blue.png" rel="nofollow" target="_blank"&gt;http://gis.edmondok.com/tfstudy/graphics/pushpin_blue.png&lt;/A&gt;&lt;SPAN&gt;', 30, 30);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; symbol2 = new PictureMarkerSymbol('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fgis.edmondok.com%2Ftfstudy%2Fgraphics%2Fpushpin_green.png" rel="nofollow" target="_blank"&gt;http://gis.edmondok.com/tfstudy/graphics/pushpin_green.png&lt;/A&gt;&lt;SPAN&gt;', 30, 30);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; symbol3 = new PictureMarkerSymbol('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fgis.edmondok.com%2Ftfstudy%2Fgraphics%2Fpushpin_red.png" rel="nofollow" target="_blank"&gt;http://gis.edmondok.com/tfstudy/graphics/pushpin_red.png&lt;/A&gt;&lt;SPAN&gt;', 30, 30); &lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; // Graphics Layers with Picture Symbols&lt;BR /&gt; var symbol1GraphicsLayer = new GraphicsLayer();&lt;BR /&gt; var symbol2GraphicsLayer = new GraphicsLayer();&lt;BR /&gt; var symbol3GraphicsLayer = new GraphicsLayer();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Feature Layer:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;// Feature Layers&lt;BR /&gt; // 01. Traffic Intersections 1&lt;BR /&gt;&lt;SPAN&gt; //var trafficInt1 = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fservices6.arcgis.com%2FrCwK7cyJnCFF9MvM%2Farcgis%2Frest%2Fservices%2FTrafficIntersections%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;http://services6.arcgis.com/rCwK7cyJnCFF9MvM/arcgis/rest/services/TrafficIntersections/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var trafficInt1 = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FMilitary%2FFeatureServer%2F6" rel="nofollow" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/6&lt;/A&gt;&lt;SPAN&gt;", {&lt;/SPAN&gt;&lt;BR /&gt; mode: FeatureLayer.MODE_SNAPSHOT,&lt;BR /&gt; &lt;STRONG&gt;visible: false,&lt;/STRONG&gt;&lt;BR /&gt; outFields: ["*"]&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Draw and Editing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create Draw and Edit Toolbars 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp;function createToolbar1() {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;drawToolbar1 = new Draw(map);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;editToolbar1 = new Edit(map);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;drawToolbar1.on("draw-complete", addGraphicToMap1);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;function addGraphicToMap1(evt) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;map.graphics.clear();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;newAttributes1 = {"direction": "1"};&lt;BR /&gt;&amp;nbsp; &amp;nbsp;newFeature1 = new Graphic(evt.geometry, null, newAttributes1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;value1 = map.graphics.add(new Graphic(evt.geometry, symbol1, newAttributes1));&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Graphic geometry for Hot Spot 1 is: ", value1);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; function addGraphicToTrafficInt1(evt) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;value4 = trafficInt1.applyEdits([newFeature1], null, null); &lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log("Graphic Applied to Feature Layer (0)", value4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;// Graphics Layer and Adding Geometry&lt;BR /&gt;&amp;nbsp; &amp;nbsp;newFeature1.setSymbol(symbol1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;symbol1GraphicsLayer.add(newFeature1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;map.addLayer(symbol1GraphicsLayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;alert("You have successfully added Hot Spot 1") &lt;BR /&gt;&amp;nbsp; &amp;nbsp;drawToolbar1.deactivate();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;editToolbar1.deactivate();&lt;BR /&gt; &lt;BR /&gt; registry.byId("Point1").on("click", function editDisconnect1(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;drawToolbar1.deactivate();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;editToolbar1.deactivate();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;alert("Hot Spot 1 has already been added.")&lt;BR /&gt; });&lt;BR /&gt; dojo.disconnect(handle4);&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any ideas? &amp;nbsp;As always, thanks for the feedback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 15:27:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398435#M36692</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2016-12-02T15:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Want to Keep Feature Layer Invisible, but Graphic Layer Visible,  It disappears when FL is set to Visible: False</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398436#M36693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure graphic/feature only exists in one layer. &amp;nbsp;If you want to 'move' it to a different layer you should first clone it, and you can use the toJson() method to help in this task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; newGraphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Graphic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;oldGraphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toJson&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 17:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398436#M36693</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2016-12-02T17:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Want to Keep Feature Layer Invisible, but Graphic Layer Visible,  It disappears when FL is set to Visible: False</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398437#M36694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, I am still having some issues.&amp;nbsp; Not sure how to clone a graphic.&amp;nbsp; I can get the graphics layer to draw and stick, but when changing the map extent, it will vanish.&amp;nbsp; Here is my current code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;// ***********************************************************************&lt;BR /&gt;&amp;nbsp;// * Traffic Intersection 2 - Draw/Edit Tool Operations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;BR /&gt;&amp;nbsp;// ***********************************************************************&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Activate Draw Toolbar 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function activateTool2() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar2.activate(Draw.POINT);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Create Draw and Edit Toolbars 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function createToolbar2() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; drawToolbar2 = new Draw(map);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar2 = new Edit(map);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar2.on("draw-complete", addGraphicToMap2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function addGraphicToMap2(evt) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; map.graphics.clear();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newAttributes2 = {"Editor": "HS2"};&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newFeature2 = new Graphic(evt.geometry, null, newAttributes2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Adding the Geometry with Symbol to the Graphic Layer 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; symbol2GraphicsLayer.add(newFeature2, symbol2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Adds Graphic Layer to the Map 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; map.addLayer(symbol2GraphicsLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value2 = map.graphics.add(new Graphic(evt.geometry, symbol2, newAttributes2));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; console.log("Graphic geometry for Hot Spot 2: ", value2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;function addGraphicToTrafficInt2(evt) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value5 = trafficInt2.applyEdits([newFeature2], null, null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; console.log("Graphic Applied to Feature Layer (1)", value5)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Setting the Symbol and the Graphic to the Graphic Layer 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newFeature2.setSymbol(symbol2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; symbol2GraphicsLayer.add(newFeature2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("You have successfully added Hot Spot 2")&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar2.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar2.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;registry.byId("Point2").on("click", function editDisconnect2(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; drawToolbar2.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar2.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; alert("Hot Spot 2 has already been added.")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;});&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dojo.disconnect(handle5);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // ***********************************************************************&lt;BR /&gt;&amp;nbsp; // * Traffic Intersection 3 - Draw/Edit Tool Operations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;BR /&gt;&amp;nbsp; // ***********************************************************************&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Activate Draw Toolbar 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function activateTool3() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar3.activate(Draw.POINT);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Create Draw and Edit Toolbars 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function createToolbar3() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; drawToolbar3 = new Draw(map);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar3 = new Edit(map);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar3.on("draw-complete", addGraphicToMap3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function addGraphicToMap3(evt) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; map.graphics.clear();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newAttributes3 = {"Editor": "3"};&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newFeature3 = new Graphic(evt.geometry, null, newAttributes3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Setting the Symbol and the Graphic to the Graphic Layer 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; symbol3GraphicsLayer.add(newFeature3, symbol3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Adds Graphic Layer to the Map 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; map.addLayer(symbol3GraphicsLayer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value3 = map.graphics.add(new Graphic(evt.geometry, symbol3, newAttributes3));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; console.log("Graphic geometry for Hot Spot 3 is: ", value3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;function addGraphicToTrafficInt3(evt) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value6 = trafficInt3.applyEdits([newFeature3], null, null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; console.log("Graphic Applied to Feature Layer (2)", value6)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // Setting the Symbol and the Graphic to the Graphic Layer 3&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; newFeature3.setSymbol(symbol3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; symbol3GraphicsLayer.add(newFeature3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("You have successfully added Hot Spot 3")&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drawToolbar3.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar3.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;registry.byId("Point3").on("click", function editDisconnect3(){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; drawToolbar3.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar3.deactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; alert("Hot Spot 3 has already been added.")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;});&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dojo.disconnect(handle6);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I can get the graphic layer to stick, but when panning on the map until the graphic disappears from the view, it then disappears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of the three graphics layers at once:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/277590_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when performing a pan until the blue pushpin is outside of the current view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/277591_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then pan back over and the blue pushpin is gone:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/277595_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get my graphic layers from disappearing?&amp;nbsp; Only want them to disappear when the map is closed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a tricky one.&amp;nbsp; Thanks for any additional help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 02:55:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/want-to-keep-feature-layer-invisible-but-graphic/m-p/398437#M36694</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2016-12-07T02:55:43Z</dc:date>
    </item>
  </channel>
</rss>

