<?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: How to parse only Operational Layers from Web Map in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57857#M1471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you instantiate web map from a portal item whose type is "feature service"? I'm trying to create a web map asynchronously from an ArcGISPortalItem that is simply a layer of type "feature service" and when I call WebMap.FromPortalItemAsync(...); I get an exception that reads "Invalid Item".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it expected that this constructor may only be called successfully with an ArcGISPortalItem object whose type is "web map" ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, how can I get JUST a layer object from an ArcGISPortalItem whose type is one of the various web/desktop layer types?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 May 2013 16:22:01 GMT</pubDate>
    <dc:creator>AaronConnolly</dc:creator>
    <dc:date>2013-05-23T16:22:01Z</dc:date>
    <item>
      <title>How to parse only Operational Layers from Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57855#M1469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the Document's GetMapCompleted event is it possible to get a list of the operational layers from the base map, rather than have to parse the DocumentValues property? The DocumentValues property seems to really only be a CLR object representation of the JSON that makes up the WebMap. I don't think it is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

void _webMap_GetMapCompleted(object sender, GetMapCompletedEventArgs e)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;Layer&amp;gt; operationalLayers = e.OperationalLayers;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do something with those layers ... 
}

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Our objective is to parse the web map for everything EXCEPT the basemap and add that to an existing map. Unfortunately I'm not sure that it's reliable to do that because there could be web maps whose basemap is pertinent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the map like this is not reliable either because you only know what type of layer you have, not it's intended purpose (base or operational):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

foreach(Layer layer in e.Map.Layers)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Is layer operational or base map?
&amp;nbsp;&amp;nbsp;&amp;nbsp; // No way to know?
}

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a last resort we could parse the DocumentValues property for a list of layer IDs for those in the operationalLayers List, then parse those out of the e.Map.Layers list. Again, this might not be reliable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 18:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57855#M1469</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-05-21T18:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse only Operational Layers from Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57856#M1470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For such scenario, I recommend to use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/apiref/api_start.htm?ESRI.ArcGIS.Client.Portal~ESRI.ArcGIS.Client.WebMap_namespace.html"&gt;WebMap model&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can instantiate a webmap from a portal item using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/apiref/api_start.htm?ESRI.ArcGIS.Client.Portal~ESRI.ArcGIS.Client.WebMap.WebMap~FromPortalItemAsync.html"&gt;http://resources.arcgis.com/en/help/silverlight-api/apiref/api_start.htm?ESRI.ArcGIS.Client.Portal~ESRI.ArcGIS.Client.WebMap.WebMap~FromPortalItemAsync.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can modify it using the webmap API and finally create the map from the webmap using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/apiref/ESRI.ArcGIS.Client.Portal~ESRI.ArcGIS.Client.WebMap.Document~GetMapAsync(WebMap,Object).html"&gt;Document.GetMapAsync(webMap)&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 07:38:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57856#M1470</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-05-23T07:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse only Operational Layers from Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57857#M1471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dominique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you instantiate web map from a portal item whose type is "feature service"? I'm trying to create a web map asynchronously from an ArcGISPortalItem that is simply a layer of type "feature service" and when I call WebMap.FromPortalItemAsync(...); I get an exception that reads "Invalid Item".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it expected that this constructor may only be called successfully with an ArcGISPortalItem object whose type is "web map" ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, how can I get JUST a layer object from an ArcGISPortalItem whose type is one of the various web/desktop layer types?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 16:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57857#M1471</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-05-23T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse only Operational Layers from Web Map</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57858#M1472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;Can you instantiate web map from a portal item whose type is "feature service"? I'm trying to create a web map asynchronously from an ArcGISPortalItem that is simply a layer of type "feature service" and when I call WebMap.FromPortalItemAsync(...);&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No, unfortunately, for now, the creation of a webmap from a portal item works only if the item is of type WebMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To create a webmap from a portal item of type 'feature service', you have to instantiate the webmap by code (&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#CreateWebMapObject"&gt;sample&lt;/A&gt;&lt;SPAN&gt;), instantiate a webmaplayer, set the Url, Id and ItemId properties of the webmaplayer, add the webmaplayer to the webmap.OperationalLayers and create the map from the webmap &lt;/SPAN&gt;&lt;SPAN style="color: #3E3E3E; font-family: Arial;"&gt;using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/apiref/ESRI.ArcGIS.Client.Portal~ESRI.ArcGIS.Client.WebMap.Document~GetMapAsync(WebMap,Object).html"&gt;Document.GetMapAsync(webMap)&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 16:43:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-parse-only-operational-layers-from-web-map/m-p/57858#M1472</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2013-05-23T16:43:22Z</dc:date>
    </item>
  </channel>
</rss>

