<?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 Arcgis.com map service: URL and layer-IDs? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-com-map-service-url-and-layer-ids/m-p/571407#M53264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First off: I'm not sure whether to place this under Arcgis.com Online or the Javascript API, so I apologize if it's in the wrong forum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With that said, on to my questions: I am currently working on creating a customized wma based on the ArcGIS.com Map viewer (similar to the sample provided &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ags/ags_createwebmapid.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. However, the reason that I need to create a custom WMA and cannot use a ready-made template from ArcGIS.com is that I want to include a Find Task-function (similar to the sample provided &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/find/find_map_datagrid.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, in order create this function I need to know two things; first how do I find out the URL of my created map service (see first code-snip)? For instance, I created a quick web map to help me illustrate my point (&lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/webmap/viewer.html?webmap=1c47e1217e394c39abca16756786b1f7" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.arcgis.com/home/webmap/viewer.html?webmap=1c47e1217e394c39abca16756786b1f7&lt;/A&gt;&lt;SPAN&gt;). Is that URL also the URL of the map service (I haven't been able to make that one work)? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Secondly, how do I find out the Layer-ID to use in the find parameters (see second code-snip)? Are layers on ArcGIS.com given IDs based on the order they were added? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//Create Find Task using the URL of the map service to search
findTask = new esri.tasks.FindTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/TaxParcelQuery/MapServer/");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
//Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["OWNERNME1","OWNERNME2"];
findParams.outSpatialReference = map.spatialReference;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: I fixed the broken sample-link, my bad!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:34:50 GMT</pubDate>
    <dc:creator>OlaSvensson1</dc:creator>
    <dc:date>2021-12-12T00:34:50Z</dc:date>
    <item>
      <title>Arcgis.com map service: URL and layer-IDs?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-com-map-service-url-and-layer-ids/m-p/571407#M53264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First off: I'm not sure whether to place this under Arcgis.com Online or the Javascript API, so I apologize if it's in the wrong forum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With that said, on to my questions: I am currently working on creating a customized wma based on the ArcGIS.com Map viewer (similar to the sample provided &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ags/ags_createwebmapid.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. However, the reason that I need to create a custom WMA and cannot use a ready-made template from ArcGIS.com is that I want to include a Find Task-function (similar to the sample provided &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/find/find_map_datagrid.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, in order create this function I need to know two things; first how do I find out the URL of my created map service (see first code-snip)? For instance, I created a quick web map to help me illustrate my point (&lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/webmap/viewer.html?webmap=1c47e1217e394c39abca16756786b1f7" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.arcgis.com/home/webmap/viewer.html?webmap=1c47e1217e394c39abca16756786b1f7&lt;/A&gt;&lt;SPAN&gt;). Is that URL also the URL of the map service (I haven't been able to make that one work)? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Secondly, how do I find out the Layer-ID to use in the find parameters (see second code-snip)? Are layers on ArcGIS.com given IDs based on the order they were added? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//Create Find Task using the URL of the map service to search
findTask = new esri.tasks.FindTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/TaxParcelQuery/MapServer/");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
//Create the find parameters
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [0];
findParams.searchFields = ["OWNERNME1","OWNERNME2"];
findParams.outSpatialReference = map.spatialReference;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: I fixed the broken sample-link, my bad!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-com-map-service-url-and-layer-ids/m-p/571407#M53264</guid>
      <dc:creator>OlaSvensson1</dc:creator>
      <dc:date>2021-12-12T00:34:50Z</dc:date>
    </item>
  </channel>
</rss>

