<?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 get the Extent of a Dynamic Layer in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636790#M3264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That was the only way I could figure out to get the info I needed from the dynamic layers, but it only worked for me on feature layers, not on rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I can't move to 10.2 yet because we won't have enough time to test a new version and it's too high-risk for us at this time, so I am stuck with 10.1 for our current release. I am glad to hear that this functionality will be available when we are able to upgrade.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way I can get the extent from a dynamically-added raster layer using 10.1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 18:35:19 GMT</pubDate>
    <dc:creator>ChristinaKochan</dc:creator>
    <dc:date>2013-12-10T18:35:19Z</dc:date>
    <item>
      <title>How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636787#M3261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have an ArcGISDynamicMapServiceLayer that has several layers defined in the Map Service and several Dynamic Layers added on the fly at run time because this map service is connected to an SDE Workspace. I need to get the extent of each layer within the ArcGISDynamicMapServiceLayer so our uses can have a Zoom to Layer capability. I have it working for only the layers that are statically defined in the map service but not for the layers added at run time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I have so far. In my XAML I have a context menu item defined in the LayerTempate DataTemplate for the ESRI Legend. This is the basic idea I have for my XAML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;DataTemplate x:Key="LayerTemplate"&amp;gt;
&amp;nbsp; .....
&amp;nbsp; &amp;lt;ContextMenu&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MenuItem Header="Zoom To" CommandParameter="{Binding}" Command ="{ ... DoZoomToLayer ... }" /&amp;gt;
&amp;nbsp; &amp;lt;/ContextMenu&amp;gt;
&amp;nbsp; ....
&amp;lt;/DataTemplate&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then in my ViewModel I have the following C# code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;public void DoZoomToLayer(ESRI.ArcGIS.Client.Toolkit.Primitives.LayerITemViewModel layerItemViewModel) {
&amp;nbsp; Action&amp;lt;ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo, Exception&amp;gt; action = (featureLayerIfno, exception) =&amp;gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (exception == null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (featureLayerInfo != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; App.Map.Extent = featureLayerInfo.Extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; };
&amp;nbsp; ((ArcGISDynamicMapServiceLayer)layerItemViewModel.Layer).GetDetails(layerItemViewModel.SubLayerID, action);
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the layer is a dynamic layer added on the fly at run time then the featureLayerInfo object is null. This make some sense because the GetDetails() call asks the server side map service for details on a layerID that does not exist. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So how can I get the extent of a dynamic layer added on the fly at run time?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 13:57:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636787#M3261</guid>
      <dc:creator>EricPaitz</dc:creator>
      <dc:date>2012-10-04T13:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636788#M3262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you figure this out? I've been trying to use WebClient.DownloadString(&amp;lt;dynamic layer url&amp;gt;), but while this works for feature layers, all of my raster layers just return the following json:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 20:52:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636788#M3262</guid>
      <dc:creator>ChristinaKochan</dc:creator>
      <dc:date>2013-12-09T20:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636789#M3263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide any details on why you're calling WebClient.DownloadString ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the 10.2 release many more operations in the API, such as GetDetails/GetAllDetails now supports datasources configured via DynamicLayers. Therefore, where it was previously necessary to make handcrafted calls to the endpoint, you can now use the standard API methods.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, once you've configured a new raster datasource you can call GetDetails then process the FeatureLayerInfo for the required details. The extent property will give the extent of the new datasource. This code is taken from the "Add Shapefiles and Rasters" sample in the Sample App (under Mapping &amp;gt; Dynamic Map Layers).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcGisLocalDynamicMapServiceLayer.GetDetails(dynamicLayerInfo.ID, (featureLayerInfo, exception) =&amp;gt;
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check featureLayerInfo.Extent property
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636789#M3263</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2021-12-12T03:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636790#M3264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That was the only way I could figure out to get the info I needed from the dynamic layers, but it only worked for me on feature layers, not on rasters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I can't move to 10.2 yet because we won't have enough time to test a new version and it's too high-risk for us at this time, so I am stuck with 10.1 for our current release. I am glad to hear that this functionality will be available when we are able to upgrade.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way I can get the extent from a dynamically-added raster layer using 10.1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 18:35:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636790#M3264</guid>
      <dc:creator>ChristinaKochan</dc:creator>
      <dc:date>2013-12-10T18:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636791#M3265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 10.2 SDK can be installed alongside the 10.1.1 SDK - you obviously just need to make sure that your main app/project does not automatically pick up the 10.2 assemblies. 10.2 was a significant update to 10.1.1 with a lot of new functionality and various enhancements. If you don't have time to run full certification testing then you will likely want to stick on 10.1.1 to deploy initially but obviously we would recommend you consider upgrading to 10.2 as soon as possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just ran the dynamiclayer sample/test against 10.2 - the request URL and JSON response is below - so you can check the URL you're constructing against this example. Note there's a GUID because that's what I use for the unique workspace name, but it can be any string you like. You might like to try something like &lt;/SPAN&gt;&lt;A href="http://json2csharp.com/"&gt;http://json2csharp.com/&lt;/A&gt;&lt;SPAN&gt; to generate C# classes for the JSON to make handling the response easier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;## REQUEST ##&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost.:50000/Znk7Sv/arcgis/rest/services/emptympk_wgs84/MapServer/dynamicLayer?f=json&amp;amp;layer=" rel="nofollow" target="_blank"&gt;http://localhost.:50000/Znk7Sv/arcgis/rest/services/emptympk_wgs84/MapServer/dynamicLayer?f=json&amp;amp;layer=&lt;/A&gt;&lt;SPAN&gt;{"id":0,"source":{"type":"dataLayer","dataSource":{"type": "raster","workspaceId": "78dfa62b-3a3c-4740-b1c4-f122b563795a","dataSourceName": "Photo.sid"}}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;## RESPONSE ##&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "currentVersion": 10.21,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "name": "Raster Layer",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "type": "Raster Layer",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "description": "",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "geometryType": null,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "copyrightText": "",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "subLayers": [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "minScale": 0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "maxScale": 0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "defaultVisibility": true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "extent": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmin": -72.89445320022088,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymin": 42.252009540096672,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmax": -72.845193804302411,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymax": 42.288595011042979,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "spatialReference": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "wkid": 4326,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "latestWkid": 4326&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; },&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "hasAttachments": false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "htmlPopupType": "esriServerHTMLPopupTypeNone",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "displayField": "",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "typeIdField": null,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "fields": null,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "relationships": [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "canModifyLayer": true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "canScaleSymbols": false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "hasLabels": false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "capabilities": "Map,Query",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "supportsStatistics": false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "supportsAdvancedQueries": false,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "supportedQueryFormats": "JSON, AMF",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "ownershipBasedAccessControlForFeatures": {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "allowOthersToQuery": true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; },&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "useStandardizedQueries": true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "id": 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 10:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636791#M3265</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2013-12-11T10:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the Extent of a Dynamic Layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636792#M3266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My problem was annoyingly simple: I was using "table" instead of "raster" for the data source type in my request URL, which was returning the 400 error code. All is well now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, Mike!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 21:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/how-to-get-the-extent-of-a-dynamic-layer/m-p/636792#M3266</guid>
      <dc:creator>ChristinaKochan</dc:creator>
      <dc:date>2013-12-11T21:57:19Z</dc:date>
    </item>
  </channel>
</rss>

