<?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 Finding map extent for javascript api and spatial reference in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-map-extent-for-javascript-api-and-spatial/m-p/1576111#M86403</link>
    <description>&lt;P&gt;I am having trouble in finding map extent (bounding box). How can I easily find out the extent and its format ?&lt;/P&gt;&lt;P&gt;Suppose I have this code sample:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const view = new MapView({
container: "viewDiv",
map: map,

extent: {
// autocasts as new Extent()
xmin: -9177811,
ymin: 4247000,
xmax: -9176791,
ymax: 4247784,
spatialReference: 102100&lt;/LI-CODE&gt;&lt;P&gt;I want to direct the extent (xmin/max, ymin/max) to a particular city with spatial reference 102100. How to do that ?&lt;/P&gt;&lt;P&gt;And also, spatialReference 102100 (line 11) is deprecated and changed to EPSG 3857. (&lt;A href="https://spatialreference.org/ref/esri/102100/" target="_blank"&gt;https://spatialreference.org/ref/esri/102100/&lt;/A&gt;) . Do I have to change the "spatialReference: 102100" to "spatialReference: 3857" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2025 03:26:04 GMT</pubDate>
    <dc:creator>yockee</dc:creator>
    <dc:date>2025-01-16T03:26:04Z</dc:date>
    <item>
      <title>Finding map extent for javascript api and spatial reference</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-map-extent-for-javascript-api-and-spatial/m-p/1576111#M86403</link>
      <description>&lt;P&gt;I am having trouble in finding map extent (bounding box). How can I easily find out the extent and its format ?&lt;/P&gt;&lt;P&gt;Suppose I have this code sample:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const view = new MapView({
container: "viewDiv",
map: map,

extent: {
// autocasts as new Extent()
xmin: -9177811,
ymin: 4247000,
xmax: -9176791,
ymax: 4247784,
spatialReference: 102100&lt;/LI-CODE&gt;&lt;P&gt;I want to direct the extent (xmin/max, ymin/max) to a particular city with spatial reference 102100. How to do that ?&lt;/P&gt;&lt;P&gt;And also, spatialReference 102100 (line 11) is deprecated and changed to EPSG 3857. (&lt;A href="https://spatialreference.org/ref/esri/102100/" target="_blank"&gt;https://spatialreference.org/ref/esri/102100/&lt;/A&gt;) . Do I have to change the "spatialReference: 102100" to "spatialReference: 3857" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 03:26:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-map-extent-for-javascript-api-and-spatial/m-p/1576111#M86403</guid>
      <dc:creator>yockee</dc:creator>
      <dc:date>2025-01-16T03:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding map extent for javascript api and spatial reference</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-map-extent-for-javascript-api-and-spatial/m-p/1577296#M86410</link>
      <description>&lt;P&gt;You can add a `console.log` to output the view.extent.&lt;BR /&gt;&lt;BR /&gt;If you add it inside a reactiveUtils.watch you can get it to output to the browser console as you move around the map to the city / extent that you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;          reactiveUtils.watch(
  () =&amp;gt; view.updating,
  (updating) =&amp;gt; {
    console.log('extent', view.extent)
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want the map itself to goto an extent, then you can use `goTo` and pass in a geometry that matches your extent (or use Polygon.fromExtent to convert it)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#fromExtent" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#fromExtent&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 23:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/finding-map-extent-for-javascript-api-and-spatial/m-p/1577296#M86410</guid>
      <dc:creator>JamesIng</dc:creator>
      <dc:date>2025-01-20T23:23:48Z</dc:date>
    </item>
  </channel>
</rss>

