<?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 Dynamic Map Service: Go to a specific scale and pan to point in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dynamic-map-service-go-to-a-specific-scale-and-pan/m-p/25048#M2186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using an ArcGISDynamicMapService, and given a point, I want the map to zoom out (or into) a specific scale and pan to a location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With dynamic maps, I can't find a way to set the scale manually, unlike what the level of detail (LOD) does for tiled maps. Is there something for dynamic maps where I can set a scale?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate any input. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 18:05:50 GMT</pubDate>
    <dc:creator>DanielYim</dc:creator>
    <dc:date>2010-11-02T18:05:50Z</dc:date>
    <item>
      <title>Dynamic Map Service: Go to a specific scale and pan to point</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dynamic-map-service-go-to-a-specific-scale-and-pan/m-p/25048#M2186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using an ArcGISDynamicMapService, and given a point, I want the map to zoom out (or into) a specific scale and pan to a location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With dynamic maps, I can't find a way to set the scale manually, unlike what the level of detail (LOD) does for tiled maps. Is there something for dynamic maps where I can set a scale?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate any input. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 18:05:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dynamic-map-service-go-to-a-specific-scale-and-pan/m-p/25048#M2186</guid>
      <dc:creator>DanielYim</dc:creator>
      <dc:date>2010-11-02T18:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Map Service: Go to a specific scale and pan to point</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dynamic-map-service-go-to-a-specific-scale-and-pan/m-p/25049#M2187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made a solution to those who will encounter a similar problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using my map, I zoomed out/in to the scale that I wanted to and made a dummy button that logged what's returned from esri.geometry.getScale(myMap) to get the current scale. Using that number, I used myMap.setExtent(esri.geometry.getExtentForScale(myMap, &amp;lt;scale number&amp;gt;)); to make the map zoom out or in to the scale that I want from the current view. My organization's maps take longer than usual for extent changes, so I made an event listener for the dynamic map service's onUpdateEnd to wait for the extent change to load and then center the map at the geometry that I needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code for reference. For me, 44315.3858 is what was returned from esri.geometry.getScale(myMap). parcelMap is my ArcGISDynamicMapServiceLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function reduceExtent(geom) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Adjust the current extent to the specified scale where we can see
&amp;nbsp;&amp;nbsp;&amp;nbsp; // abstracts
&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.setExtent(esri.geometry.getExtentForScale(myMap, 44315.3858));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Wait until the extent change has completed
&amp;nbsp;&amp;nbsp;&amp;nbsp; var tempHook = dojo.connect(parcelMap, "onUpdateEnd", function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Pan to the selected abstract
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.centerAt(geom.getExtent().getCenter());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Dispose of the temporary listener
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.disconnect(tempHook);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps someone.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dynamic-map-service-go-to-a-specific-scale-and-pan/m-p/25049#M2187</guid>
      <dc:creator>DanielYim</dc:creator>
      <dc:date>2021-12-10T21:01:01Z</dc:date>
    </item>
  </channel>
</rss>

