<?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 Getting IntialExtent of the ArcGISDynamicMapServiceLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220793#M20489</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using arcgis javascript api in my application and &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;working with a dynamic map service resource exposed by the ArcGIS Server REST API . Hence I am making using of the &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer to load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after adding the layer of ArcGISDynamicMapServiceLayer to the map, the map is not taking&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt; projection of this layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;So i tried using GeometryService.project by passing the ProjectParameters() and i am trying to set the&amp;nbsp; ArcGISDynamicMapServiceLayer.initialExtent and project toward it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am getting &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;ArcGISDynamicMapServiceLayer.initialExtent as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt; spatialReference: { wkid: 4326}&lt;/P&gt;&lt;P&gt; type: "extent"&lt;/P&gt;&lt;P&gt; xmax: 180&lt;/P&gt;&lt;P&gt; xmin: -180&lt;/P&gt;&lt;P&gt; ymax: 90&lt;/P&gt;&lt;P&gt; ymin: -90&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;on the first load and then after that works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is the best way if i just want to load a map and then project towards &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;ArcGISDynamicMapServiceLayer layer on the map?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 04:36:38 GMT</pubDate>
    <dc:creator>tejasnadkarni</dc:creator>
    <dc:date>2014-09-22T04:36:38Z</dc:date>
    <item>
      <title>Getting IntialExtent of the ArcGISDynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220793#M20489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using arcgis javascript api in my application and &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;working with a dynamic map service resource exposed by the ArcGIS Server REST API . Hence I am making using of the &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer to load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after adding the layer of ArcGISDynamicMapServiceLayer to the map, the map is not taking&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt; projection of this layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;So i tried using GeometryService.project by passing the ProjectParameters() and i am trying to set the&amp;nbsp; ArcGISDynamicMapServiceLayer.initialExtent and project toward it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am getting &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;ArcGISDynamicMapServiceLayer.initialExtent as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt; spatialReference: { wkid: 4326}&lt;/P&gt;&lt;P&gt; type: "extent"&lt;/P&gt;&lt;P&gt; xmax: 180&lt;/P&gt;&lt;P&gt; xmin: -180&lt;/P&gt;&lt;P&gt; ymax: 90&lt;/P&gt;&lt;P&gt; ymin: -90&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;on the first load and then after that works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is the best way if i just want to load a map and then project towards &lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', Helvetica, Arial, Verdana, sans-serif; font-size: 14px;"&gt;ArcGISDynamicMapServiceLayer layer on the map?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 04:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220793#M20489</guid>
      <dc:creator>tejasnadkarni</dc:creator>
      <dc:date>2014-09-22T04:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Getting IntialExtent of the ArcGISDynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220794#M20490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tejas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set the extent of the map to the dynamic service layer using the Map class &lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#setextent"&gt;setExtent&lt;/A&gt; method and the &lt;A href="https://developers.arcgis.com/javascript/jsapi/map-amd.html#event-layer-add-result"&gt;layer-add-result&lt;/A&gt; event. &lt;A href="http://jsfiddle.net/41cj1uvk/"&gt;Here&lt;/A&gt; is an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 12:51:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220794#M20490</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-09-22T12:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting IntialExtent of the ArcGISDynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220795#M20491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jake, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried setting the extent using the setExtent on the map but the problem is that its just showing me the world street map. Its like the my dynamic service layer is about a particular city/state and so i expect to display street view of that particular city/state when i first initialized the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/bqqof5yk/1/" title="http://jsfiddle.net/bqqof5yk/1/"&gt;http://jsfiddle.net/bqqof5yk/1/&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link. By default it shows the world map but if you zoom in towards the KANSAS you will see the graphics on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to see that KANSAS state when the map is first initialized.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 10:24:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220795#M20491</guid>
      <dc:creator>tejasnadkarni</dc:creator>
      <dc:date>2014-09-23T10:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting IntialExtent of the ArcGISDynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220796#M20492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your code, you're converting the the geographic extent to Web Mercator, but you're then trying to set the map's extent to the geographic extent. This is shown in Firebug's debugging console.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="14998" alt="firebug.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/14998_firebug.png" style="width: 620px; height: 221px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14115641711189889" jivemacro_uid="_14115641711189889" modifiedtitle="true"&gt;
&lt;P&gt;on(map, "layer-add-result", function () {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var extent = webMercatorUtils.geographicToWebMercator(dynamicLayer.initialExtent);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; map.setExtent(extent, true);&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the updated &lt;A href="http://jsfiddle.net/kenbuja/bqqof5yk/2/"&gt;Fiddle&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 13:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-intialextent-of-the/m-p/220796#M20492</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-09-24T13:16:04Z</dc:date>
    </item>
  </channel>
</rss>

