<?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: y values not honored in initial extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253216#M23413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To start with, what happens if you remove the zoom: 3? &amp;nbsp;In general, I'm not sure if setting the zoom and the extent makes sense, since they&amp;nbsp;should do the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest using a center and a zoom rather than an extent for this kind of thing. &amp;nbsp;So you could zoom to the perspective you like, and log&amp;nbsp;the center and zoom and pass those in instead of using an extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Setting an extent can be a little tricky as I recall&amp;nbsp;(been a while since I worked with 2D). &amp;nbsp;For an extent to be possible to fit exactly to&amp;nbsp;a map, the ratio between its height and width must be the same as the ratio between the map div's height and width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your map is much wider than it is tall, it may not be possible to fix your xmin, xmax, ymin, ymin as the corners of the map div. &amp;nbsp;In these situations, it would be preferable (in my opinion) if the map guaranteed than the entire extent&amp;nbsp;was fit and never cut anything off. &amp;nbsp;&amp;nbsp;But this may not be done. &amp;nbsp;My bet is that the map takes whichever dimension is longer (in this case, x, or width) and cuts off the other dimension. &amp;nbsp;This would work perfectly if the map div was a square, but if it's not it may cause one dimension to get cut off a bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 15:35:21 GMT</pubDate>
    <dc:creator>ThomasSolow</dc:creator>
    <dc:date>2017-04-25T15:35:21Z</dc:date>
    <item>
      <title>y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253215#M23412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to set the initial extent of a basemap, but for some reason I cant see, the x values are honored while the y values are ignored. &amp;nbsp;i am using 3.10 JS API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var initialExtent = new esri.geometry.Extent({&lt;/P&gt;&lt;P&gt;"xmin":969819.213195 ,&lt;/P&gt;&lt;P&gt;"ymin":187672.422691 ,&lt;/P&gt;&lt;P&gt;"xmax":1035263.657639 ,&lt;/P&gt;&lt;P&gt;"ymax": 225505.756024,&lt;/P&gt;&lt;P&gt;"spatialReference": {&lt;BR /&gt; "wkid": 102718&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the I add to map constructor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map = new Map("map", {&lt;BR /&gt; zoom: 3,&lt;BR /&gt; sliderPosition: "top-right",&lt;BR /&gt; sliderStyle: "small",&lt;BR /&gt; extent: initialExtent,&lt;BR /&gt; infoWindow: infoWindowPopup&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I check it with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dojo.connect(map, "onExtentChange", showExtent);&lt;BR /&gt; function showExtent(extent) {&lt;BR /&gt; var s = "";&lt;BR /&gt; s = "XMin: "+ extent.xmin.toFixed(6) + " "&lt;BR /&gt; +"YMin: " + extent.ymin.toFixed(6) + " "&lt;BR /&gt; +"XMax: " + extent.xmax.toFixed(6) + " "&lt;BR /&gt; +"YMax: " + extent.ymax.toFixed(6);&lt;BR /&gt; console.log('s: ' + s);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on the initial load, the x values are exactly what I have above, but the y values are both lower values. &amp;nbsp;Even if I move the map, and add the new extent given in console to the code, the map does not set to my y values after refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is happening here? I know the extent I am trying to set is well within the extent of the basemap.extent calculation&amp;nbsp;javscript api&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 14:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253215#M23412</guid>
      <dc:creator>deleted-user-3QvhwBivZdaR</dc:creator>
      <dc:date>2017-04-25T14:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253216#M23413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To start with, what happens if you remove the zoom: 3? &amp;nbsp;In general, I'm not sure if setting the zoom and the extent makes sense, since they&amp;nbsp;should do the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest using a center and a zoom rather than an extent for this kind of thing. &amp;nbsp;So you could zoom to the perspective you like, and log&amp;nbsp;the center and zoom and pass those in instead of using an extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Setting an extent can be a little tricky as I recall&amp;nbsp;(been a while since I worked with 2D). &amp;nbsp;For an extent to be possible to fit exactly to&amp;nbsp;a map, the ratio between its height and width must be the same as the ratio between the map div's height and width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your map is much wider than it is tall, it may not be possible to fix your xmin, xmax, ymin, ymin as the corners of the map div. &amp;nbsp;In these situations, it would be preferable (in my opinion) if the map guaranteed than the entire extent&amp;nbsp;was fit and never cut anything off. &amp;nbsp;&amp;nbsp;But this may not be done. &amp;nbsp;My bet is that the map takes whichever dimension is longer (in this case, x, or width) and cuts off the other dimension. &amp;nbsp;This would work perfectly if the map div was a square, but if it's not it may cause one dimension to get cut off a bit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 15:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253216#M23413</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-04-25T15:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253217#M23414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok Ill look at those things..I guess I assumed the map's extent in a web app would be tied to the size &amp;nbsp;/ dimensions of the viewport...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one thing, the y values that change seem to both move 'down'...it doesnt appear to be resetting the extent based on a different proportion...but Ill try some other methods anyway&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 15:43:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253217#M23414</guid>
      <dc:creator>deleted-user-3QvhwBivZdaR</dc:creator>
      <dc:date>2017-04-25T15:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253218#M23415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's almost impossible to set the exact min and maxes of an extent when you're dealing with a tiled basemap. The zoom levels are set to specific scales which probably don't conform to the extent that you're attempting to set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 20:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253218#M23415</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-04-25T20:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253219#M23416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that makes sense I suppose, but what is a workaround then? Do we need to make a basemap for every web app? It's so easy to set any extent and zoom level, basemap included, on ArcGIS Online, why cant it be so with a JS based web app?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 19:42:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253219#M23416</guid>
      <dc:creator>deleted-user-3QvhwBivZdaR</dc:creator>
      <dc:date>2017-04-26T19:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: y values not honored in initial extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253220#M23417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ps I did try center and zoom but still cant set the initial extent the way I want...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 19:43:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/y-values-not-honored-in-initial-extent/m-p/253220#M23417</guid>
      <dc:creator>deleted-user-3QvhwBivZdaR</dc:creator>
      <dc:date>2017-04-26T19:43:28Z</dc:date>
    </item>
  </channel>
</rss>

