<?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: Feature Partially Obscured after Zoom to Extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289509#M26636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's a good thing to know as I convert my projects to JavaScript!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Mar 2013 18:36:31 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2013-03-15T18:36:31Z</dc:date>
    <item>
      <title>Feature Partially Obscured after Zoom to Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289505#M26632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use the following to zoom to a selected feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var feature = fset.features[0]; myMap.graphics.add(feature); myMap.setExtent(feature.geometry.getExtent());&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Which works, but sometimes the feature is partially obscured by the limits of the map div.&amp;nbsp; For example, in this map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://maps.puc.state.oh.us/exchange/index.asp" rel="nofollow" target="_blank"&gt;http://maps.puc.state.oh.us/exchange/index.asp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you select "Aberdeen" from the drop down, then the zoom works as I'd like.&amp;nbsp; If you select "Adamsville", then you'll see what I'm talking about.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions to fix that?&amp;nbsp; Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 16:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289505#M26632</guid>
      <dc:creator>MattFancher</dc:creator>
      <dc:date>2013-03-15T16:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Partially Obscured after Zoom to Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289506#M26633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see what you mean. Here are some thoughts though I am sure there are numerous other solutions out there:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) setExtent(extent, fit?) note that there is fit? option. If you are using Tiled layers then maybe this would help?&amp;nbsp; Not sure, never really used this option.&amp;nbsp; Here is the documentation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/map.html#Map/setExtent" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/map.html#Map/setExtent&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;NOTE: read the documentation on this. I am not sure if I am correct on my assumption of the fit? param.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Generally, I like to expand the extent so that it gives the map a little room/margin around your selected feature. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.setExtent(extent.expand(expandFactor));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Never tired this but it looks like other features beside the one that you pointed out had issues with zoom scale. Try seeing with the following will do for you. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;esri.geometry.getExtentForScale(map, scale)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/namespace_geometry.html#namespace_geometry/getExtentForScale" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/namespace_geometry.html#namespace_geometry/getExtentForScale&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 16:50:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289506#M26633</guid>
      <dc:creator>DianaBenedict</dc:creator>
      <dc:date>2013-03-15T16:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Partially Obscured after Zoom to Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289507#M26634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In my applications where I have a tiled basemap and I perform a zoom to a feature, I check whether the extent of that feature is contained by the extent of the map. If not, then I move out one level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although this code is for Flex, you should be able to use the same logic in JavaScript&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
map.extent = feature.extent;
if (!map.extent.contains(feature.extent))
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.level--;
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289507#M26634</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T13:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Partially Obscured after Zoom to Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289508#M26635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Diana and Ken!&amp;nbsp; Diana's suggetion to set the optional fit parameter on the setExtent method very quickly solved the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 18:01:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289508#M26635</guid>
      <dc:creator>MattFancher</dc:creator>
      <dc:date>2013-03-15T18:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Partially Obscured after Zoom to Extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289509#M26636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's a good thing to know as I convert my projects to JavaScript!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 18:36:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-partially-obscured-after-zoom-to-extent/m-p/289509#M26636</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-03-15T18:36:31Z</dc:date>
    </item>
  </channel>
</rss>

