<?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 add a graphics layer to a webmap.map in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128750#M1483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt is correct that graphics overlays are the way to overlay graphics on a webmap. The webmap spec in fact does not contain a definition for graphics, instead these are handled as feature collections. In order to persist client-side graphics in a webmap they need to be push in as a featurecollection (&lt;A href="http://resources.arcgis.com/en/help/arcgis-web-map-json/index.html#/Feature_collection_operational_layer/02qt00000019000000/" title="http://resources.arcgis.com/en/help/arcgis-web-map-json/index.html#/Feature_collection_operational_layer/02qt00000019000000/"&gt;ArcGIS web map JSON format&lt;/A&gt;​).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the roadmap for the .NET API is full support for reading and writing webmaps (in the runtime they are the 'map') at which time we plan to have a featurecollection type which is effectively an in-memory feature layer and will be persisted in any maps you save. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Aug 2015 08:55:19 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2015-08-14T08:55:19Z</dc:date>
    <item>
      <title>How to add a graphics layer to a webmap.map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128746#M1479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just need to add all my layers from a webmap to a map then add a graphics layer, is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I keep getting this error "cannot modify layers collection directly when managed by webmapviewmodel"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 15:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128746#M1479</guid>
      <dc:creator>MattMiley1</dc:creator>
      <dc:date>2015-08-03T15:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a graphics layer to a webmap.map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128747#M1480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a work around&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Loads the given webmap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private async Task LoadWebMapAsync(string wmId)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&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; _portal = await ArcGISPortal.CreateAsync();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; var item = await ArcGISPortalItem.CreateAsync(_portal, wmId);&lt;/P&gt;&lt;P&gt;&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; var webmap = await WebMap.FromPortalItemAsync(item);&lt;/P&gt;&lt;P&gt;&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; var vm = await WebMapViewModel.LoadAsync(webmap, _portal);&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;&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; foreach (var layer in vm.Map.Layers)&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp; //Add each layer individually&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp; Map.Layers.Add(layer);&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&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; var vmr = new ErrorMessagesClass();&lt;/P&gt;&lt;P&gt;&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; vmr.ErrorMessages(ex.Message);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 17:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128747#M1480</guid>
      <dc:creator>MattMiley1</dc:creator>
      <dc:date>2015-08-03T17:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a graphics layer to a webmap.map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128748#M1481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My work around doesnt work, it crash the next time i to any kind of async after loading the web map. Does anyone have any ideas how to mix webmap layers with graphic layers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 14:57:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128748#M1481</guid>
      <dc:creator>MattMiley1</dc:creator>
      <dc:date>2015-08-13T14:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a graphics layer to a webmap.map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128749#M1482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I struggled with the same issue.&amp;nbsp; The map on the WebMapViewModel is readonly.&amp;nbsp; I think the proper approach is to add graphic overlays to the map view control itself.&amp;nbsp; The nicest part is this can be done with xaml.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/122309_Capture.PNG" style="width: 620px; height: 226px;" /&gt;&lt;/P&gt;&lt;P&gt;You'll need to create a renderer for each graphic which also can be done with xaml.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/122311_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;You can add and remove individual graphics in code behind by accessing the graphic overlays collection.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/122310_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Hope that helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2015 22:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128749#M1482</guid>
      <dc:creator>MattBryant1</dc:creator>
      <dc:date>2015-08-13T22:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a graphics layer to a webmap.map</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128750#M1483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt is correct that graphics overlays are the way to overlay graphics on a webmap. The webmap spec in fact does not contain a definition for graphics, instead these are handled as feature collections. In order to persist client-side graphics in a webmap they need to be push in as a featurecollection (&lt;A href="http://resources.arcgis.com/en/help/arcgis-web-map-json/index.html#/Feature_collection_operational_layer/02qt00000019000000/" title="http://resources.arcgis.com/en/help/arcgis-web-map-json/index.html#/Feature_collection_operational_layer/02qt00000019000000/"&gt;ArcGIS web map JSON format&lt;/A&gt;​).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the roadmap for the .NET API is full support for reading and writing webmaps (in the runtime they are the 'map') at which time we plan to have a featurecollection type which is effectively an in-memory feature layer and will be persisted in any maps you save. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2015 08:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-add-a-graphics-layer-to-a-webmap-map/m-p/128750#M1483</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2015-08-14T08:55:19Z</dc:date>
    </item>
  </channel>
</rss>

