<?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: GetLayerByName in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getlayerbyname/m-p/630948#M16217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did anyone wrote a function to get a layer from map service (dynamic or tiled) by its name not by its ID ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what you call the layer name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to get the layer you need by looping on the Map layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example to get the layer having a specified MapName, you can get it by code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myLayer = myMap.Layers.OfType&amp;lt;ArcGISDynamicMapServiceLayer&amp;gt;().FirstOrDefault(l =&amp;gt; l.MapName == "SpecifiedMapName");&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2011 11:09:03 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2011-07-27T11:09:03Z</dc:date>
    <item>
      <title>GetLayerByName</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getlayerbyname/m-p/630947#M16216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did anyone wrote a function to get a layer from map service (dynamic or tiled) by its name not by its ID ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alaa B. Rasheed&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 08:07:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getlayerbyname/m-p/630947#M16216</guid>
      <dc:creator>AlaaB__Rasheed</dc:creator>
      <dc:date>2011-07-27T08:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: GetLayerByName</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getlayerbyname/m-p/630948#M16217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did anyone wrote a function to get a layer from map service (dynamic or tiled) by its name not by its ID ?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what you call the layer name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to get the layer you need by looping on the Map layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example to get the layer having a specified MapName, you can get it by code like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myLayer = myMap.Layers.OfType&amp;lt;ArcGISDynamicMapServiceLayer&amp;gt;().FirstOrDefault(l =&amp;gt; l.MapName == "SpecifiedMapName");&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 11:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/getlayerbyname/m-p/630948#M16217</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-07-27T11:09:03Z</dc:date>
    </item>
  </channel>
</rss>

