<?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 keep the map in the map extent? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-keep-the-map-in-the-map-extent/m-p/477144#M44327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know if I completely understand your questions, but let me try to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can set the map extent in reference to the basemap added to your application. The map takes the spatial reference of the first layer added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So make sure the extent you are passing is in the spatial reference of the first layer added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even if you have added your county limits as the dynamic map or feature layer, you need to specify the map extent in reference to the basemap. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how you should specify the map extent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var initExtent = new esri.geometry.Extent({"xmin":-13814922,"ymin":332653,"xmax":6222585,"ymax":10351408,"spatialReference":{"wkid":102100}});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = new esri.Map("map",{extent:initExtent});&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:04:53 GMT</pubDate>
    <dc:creator>ShreyasVakil</dc:creator>
    <dc:date>2021-12-11T21:04:53Z</dc:date>
    <item>
      <title>How to keep the map in the map extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-keep-the-map-in-the-map-extent/m-p/477143#M44326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I show the map in the map extent of the map service, assigned in the reference layer - in my case it shwos only the County limits- and ignore the map extent from the base map that covers the whole world.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 12:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-keep-the-map-in-the-map-extent/m-p/477143#M44326</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2012-11-15T12:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to keep the map in the map extent?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-keep-the-map-in-the-map-extent/m-p/477144#M44327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know if I completely understand your questions, but let me try to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can set the map extent in reference to the basemap added to your application. The map takes the spatial reference of the first layer added to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So make sure the extent you are passing is in the spatial reference of the first layer added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even if you have added your county limits as the dynamic map or feature layer, you need to specify the map extent in reference to the basemap. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how you should specify the map extent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var initExtent = new esri.geometry.Extent({"xmin":-13814922,"ymin":332653,"xmax":6222585,"ymax":10351408,"spatialReference":{"wkid":102100}});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var map = new esri.Map("map",{extent:initExtent});&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:04:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-keep-the-map-in-the-map-extent/m-p/477144#M44327</guid>
      <dc:creator>ShreyasVakil</dc:creator>
      <dc:date>2021-12-11T21:04:53Z</dc:date>
    </item>
  </channel>
</rss>

