<?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 Mixing FeatureLayer and KMLLayer on same map breaks edit ability in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mixing-featurelayer-and-kmllayer-on-same-map/m-p/125535#M11678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, I have a map with multiple FeatureLayers and KMLLayers. Prior to adding the KMLLayers, I was able to edit/draw on the FeatureLayers &amp;nbsp;using the simple tools provided. After adding KMLLayers, I'm still able to draw, but when I click on any graphic/feature, or right after drawing a new graphic, I get a "No information available" popup window. Here's a sample code I've taken from here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=ed_simpletoolbar" title="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=ed_simpletoolbar" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt;&amp;nbsp; with a couple of lines added to add a KMLLayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var map;

 require([
 "esri/map",
 "esri/tasks/GeometryService",

 "esri/layers/ArcGISTiledMapServiceLayer",
 "esri/layers/FeatureLayer",
&lt;STRONG&gt; "esri/layers/KMLLayer",&lt;/STRONG&gt;

 "esri/Color",
 "esri/symbols/SimpleMarkerSymbol",
 "esri/symbols/SimpleLineSymbol",

 "esri/dijit/editing/Editor",
 "esri/dijit/editing/TemplatePicker",

 "esri/config",
 "dojo/i18n!esri/nls/jsapi",

 "dojo/_base/array", "dojo/parser", "dojo/keys",

 "dijit/layout/BorderContainer", "dijit/layout/ContentPane",
 "dojo/domReady!"
 ], function(
 Map, GeometryService,
 ArcGISTiledMapServiceLayer, FeatureLayer, &lt;STRONG&gt;KMLLayer,&lt;/STRONG&gt;
 Color, SimpleMarkerSymbol, SimpleLineSymbol,
 Editor, TemplatePicker,
 esriConfig, jsapiBundle,
 arrayUtils, parser, keys
 ) {
 parser.parse();

 // snapping is enabled for this sample - change the tooltip to reflect this
 jsapiBundle.toolbars.draw.start = jsapiBundle.toolbars.draw.start + "&amp;lt;br&amp;gt;Press &amp;lt;b&amp;gt;ALT&amp;lt;/b&amp;gt; to enable snapping";

 // refer to "Using the Proxy Page" for more information: https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html
 esriConfig.defaults.io.proxyUrl = "/proxy/";

 //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications.
 esriConfig.defaults.geometryService = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

 map = new Map("map", {
 basemap: "satellite",
 center: [-96.541, 38.351],
 zoom: 14,
 slider: false
 });

 map.on("layers-add-result", initEditor);

 //add boundaries and place names
 var labels = new ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer");
 map.addLayer(labels);

 var responsePoints = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0", {
 mode: FeatureLayer.MODE_ONDEMAND,
 outFields: ['*']
 });

 var responsePolys = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2", {
 mode: FeatureLayer.MODE_ONDEMAND,
 outFields: ['*']
 });
 
 map.addLayers([responsePolys, responsePoints]);
 
 &lt;STRONG&gt;var kmlUrl = 'http://dl.dropbox.com/u/2654618/kml/Wyoming.kml';&lt;/STRONG&gt;
&lt;STRONG&gt; var kml = new esri.layers.KMLLayer(kmlUrl); &lt;/STRONG&gt;
&lt;STRONG&gt; map.addLayer(kml);&lt;/STRONG&gt;
 
 function initEditor(evt) {
 var templateLayers = arrayUtils.map(evt.layers, function(result){
 return result.layer;
 });
 var templatePicker = new TemplatePicker({
 featureLayers: [responsePolys, responsePoints],
 grouping: true,
 rows: "auto",
 columns: 3
 }, "templateDiv");
 templatePicker.startup();

 var layers = arrayUtils.map(evt.layers, function(result) {
 return { featureLayer: result.layer };
 });
 var settings = {
 map: map,
 templatePicker: templatePicker,
 layerInfos: layers,
 toolbarVisible: true,
 createOptions: {
 polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ],
 polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON,
 Editor.CREATE_TOOL_CIRCLE,
 Editor.CREATE_TOOL_TRIANGLE,
 Editor.CREATE_TOOL_RECTANGLE
 ]
 },
 toolbarOptions: {
 reshapeVisible: true
 }
 };

 var params = { settings: settings };
 var myEditor = new Editor(params, 'editorDiv');
 //define snapping options
 var symbol = new SimpleMarkerSymbol(
 SimpleMarkerSymbol.STYLE_CROSS,
 15,
 new SimpleLineSymbol(
 SimpleLineSymbol.STYLE_SOLID,
 new Color([255, 0, 0, 0.5]),
 5
 ),
 null
 );
 map.enableSnapping({
 snapPointSymbol: symbol,
 tolerance: 20,
 snapKey: keys.ALT
 });

 myEditor.startup();
 }
 });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have bolded the new code. JSFiddle here:&amp;nbsp;&lt;A class="link-titled" href="http://jsfiddle.net/7m1L2kod/" title="http://jsfiddle.net/7m1L2kod/" rel="nofollow noopener noreferrer" target="_blank"&gt;Edit fiddle - JSFiddle&lt;/A&gt;. In the JSFiddle example, for some reasons, the first drawn graphic will show the proper info window with a delete button, but any subsequent action to a new/existing graphic will only display a "No information available".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:03:08 GMT</pubDate>
    <dc:creator>DamNguyen</dc:creator>
    <dc:date>2021-12-12T16:03:08Z</dc:date>
    <item>
      <title>Mixing FeatureLayer and KMLLayer on same map breaks edit ability</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mixing-featurelayer-and-kmllayer-on-same-map/m-p/125535#M11678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, I have a map with multiple FeatureLayers and KMLLayers. Prior to adding the KMLLayers, I was able to edit/draw on the FeatureLayers &amp;nbsp;using the simple tools provided. After adding KMLLayers, I'm still able to draw, but when I click on any graphic/feature, or right after drawing a new graphic, I get a "No information available" popup window. Here's a sample code I've taken from here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=ed_simpletoolbar" title="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=ed_simpletoolbar" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt;&amp;nbsp; with a couple of lines added to add a KMLLayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var map;

 require([
 "esri/map",
 "esri/tasks/GeometryService",

 "esri/layers/ArcGISTiledMapServiceLayer",
 "esri/layers/FeatureLayer",
&lt;STRONG&gt; "esri/layers/KMLLayer",&lt;/STRONG&gt;

 "esri/Color",
 "esri/symbols/SimpleMarkerSymbol",
 "esri/symbols/SimpleLineSymbol",

 "esri/dijit/editing/Editor",
 "esri/dijit/editing/TemplatePicker",

 "esri/config",
 "dojo/i18n!esri/nls/jsapi",

 "dojo/_base/array", "dojo/parser", "dojo/keys",

 "dijit/layout/BorderContainer", "dijit/layout/ContentPane",
 "dojo/domReady!"
 ], function(
 Map, GeometryService,
 ArcGISTiledMapServiceLayer, FeatureLayer, &lt;STRONG&gt;KMLLayer,&lt;/STRONG&gt;
 Color, SimpleMarkerSymbol, SimpleLineSymbol,
 Editor, TemplatePicker,
 esriConfig, jsapiBundle,
 arrayUtils, parser, keys
 ) {
 parser.parse();

 // snapping is enabled for this sample - change the tooltip to reflect this
 jsapiBundle.toolbars.draw.start = jsapiBundle.toolbars.draw.start + "&amp;lt;br&amp;gt;Press &amp;lt;b&amp;gt;ALT&amp;lt;/b&amp;gt; to enable snapping";

 // refer to "Using the Proxy Page" for more information: https://developers.arcgis.com/javascript/3/jshelp/ags_proxy.html
 esriConfig.defaults.io.proxyUrl = "/proxy/";

 //This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications.
 esriConfig.defaults.geometryService = new GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

 map = new Map("map", {
 basemap: "satellite",
 center: [-96.541, 38.351],
 zoom: 14,
 slider: false
 });

 map.on("layers-add-result", initEditor);

 //add boundaries and place names
 var labels = new ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer");
 map.addLayer(labels);

 var responsePoints = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0", {
 mode: FeatureLayer.MODE_ONDEMAND,
 outFields: ['*']
 });

 var responsePolys = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2", {
 mode: FeatureLayer.MODE_ONDEMAND,
 outFields: ['*']
 });
 
 map.addLayers([responsePolys, responsePoints]);
 
 &lt;STRONG&gt;var kmlUrl = 'http://dl.dropbox.com/u/2654618/kml/Wyoming.kml';&lt;/STRONG&gt;
&lt;STRONG&gt; var kml = new esri.layers.KMLLayer(kmlUrl); &lt;/STRONG&gt;
&lt;STRONG&gt; map.addLayer(kml);&lt;/STRONG&gt;
 
 function initEditor(evt) {
 var templateLayers = arrayUtils.map(evt.layers, function(result){
 return result.layer;
 });
 var templatePicker = new TemplatePicker({
 featureLayers: [responsePolys, responsePoints],
 grouping: true,
 rows: "auto",
 columns: 3
 }, "templateDiv");
 templatePicker.startup();

 var layers = arrayUtils.map(evt.layers, function(result) {
 return { featureLayer: result.layer };
 });
 var settings = {
 map: map,
 templatePicker: templatePicker,
 layerInfos: layers,
 toolbarVisible: true,
 createOptions: {
 polylineDrawTools:[ Editor.CREATE_TOOL_FREEHAND_POLYLINE ],
 polygonDrawTools: [ Editor.CREATE_TOOL_FREEHAND_POLYGON,
 Editor.CREATE_TOOL_CIRCLE,
 Editor.CREATE_TOOL_TRIANGLE,
 Editor.CREATE_TOOL_RECTANGLE
 ]
 },
 toolbarOptions: {
 reshapeVisible: true
 }
 };

 var params = { settings: settings };
 var myEditor = new Editor(params, 'editorDiv');
 //define snapping options
 var symbol = new SimpleMarkerSymbol(
 SimpleMarkerSymbol.STYLE_CROSS,
 15,
 new SimpleLineSymbol(
 SimpleLineSymbol.STYLE_SOLID,
 new Color([255, 0, 0, 0.5]),
 5
 ),
 null
 );
 map.enableSnapping({
 snapPointSymbol: symbol,
 tolerance: 20,
 snapKey: keys.ALT
 });

 myEditor.startup();
 }
 });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have bolded the new code. JSFiddle here:&amp;nbsp;&lt;A class="link-titled" href="http://jsfiddle.net/7m1L2kod/" title="http://jsfiddle.net/7m1L2kod/" rel="nofollow noopener noreferrer" target="_blank"&gt;Edit fiddle - JSFiddle&lt;/A&gt;. In the JSFiddle example, for some reasons, the first drawn graphic will show the proper info window with a delete button, but any subsequent action to a new/existing graphic will only display a "No information available".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mixing-featurelayer-and-kmllayer-on-same-map/m-p/125535#M11678</guid>
      <dc:creator>DamNguyen</dc:creator>
      <dc:date>2021-12-12T16:03:08Z</dc:date>
    </item>
  </channel>
</rss>

