<?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 Zooming to an area on a map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-to-an-area-on-a-map/m-p/270583#M24899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a completely new to this mapping API and I'm hoping that someone can point me in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I'm using OneMap and it's basemap which is Singapore. OneMap can be extended via ArcGis. I would like to be able to programmatically move to an area in the map and zoom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in so that the area fully fits the view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I have tried to do it via Extents. To get the desired Extent I manually zoomed in and panned to the area and noted the Extent xmin, xmax etc from the innerHtml of a div where I was setting them to from the onExtentChange event handler. However when I call map.setExtent() no map is shown and the level is wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was just an experiment and it looked like this isn't a reliable way to do this as it seemed to depend on what width and height I set the map div to. Although it would be good to know why setting the Extent didn't work. I did ensure the wkid was the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Set Map Extent&lt;/SPAN&gt;&lt;SPAN&gt; example shows how you can set the extent of the map to the extent of one of its layers. Would this approach work for me? Presumably having a layer for each area on the map. I don't think these layers &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;exist on the OneMap server perhaps there is another source to get them from or I would have to create them myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps there are a number of ways to do this any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 15:01:31 GMT</pubDate>
    <dc:creator>martinholmes</dc:creator>
    <dc:date>2012-03-23T15:01:31Z</dc:date>
    <item>
      <title>Zooming to an area on a map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-to-an-area-on-a-map/m-p/270583#M24899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a completely new to this mapping API and I'm hoping that someone can point me in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I'm using OneMap and it's basemap which is Singapore. OneMap can be extended via ArcGis. I would like to be able to programmatically move to an area in the map and zoom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in so that the area fully fits the view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I have tried to do it via Extents. To get the desired Extent I manually zoomed in and panned to the area and noted the Extent xmin, xmax etc from the innerHtml of a div where I was setting them to from the onExtentChange event handler. However when I call map.setExtent() no map is shown and the level is wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This was just an experiment and it looked like this isn't a reliable way to do this as it seemed to depend on what width and height I set the map div to. Although it would be good to know why setting the Extent didn't work. I did ensure the wkid was the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Set Map Extent&lt;/SPAN&gt;&lt;SPAN&gt; example shows how you can set the extent of the map to the extent of one of its layers. Would this approach work for me? Presumably having a layer for each area on the map. I don't think these layers &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;exist on the OneMap server perhaps there is another source to get them from or I would have to create them myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps there are a number of ways to do this any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 15:01:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zooming-to-an-area-on-a-map/m-p/270583#M24899</guid>
      <dc:creator>martinholmes</dc:creator>
      <dc:date>2012-03-23T15:01:31Z</dc:date>
    </item>
  </channel>
</rss>

