<?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: Can't get correct extent on World Stree Map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85440#M7742</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The conceptual help topic &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/intro_extents.htm"&gt;Working with Extents&lt;/A&gt;&lt;SPAN&gt; is worth a read.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your example that doesn't work, you're specifying what looks like lat, long coordinates but saying the spatial reference is web mercator (wkid 102100). If you want to create an extent as lat, long but apply it to a map service that uses webmercator, create the extent as lat, long (wkid 4326) and convert it to webmercator using &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#geographicToWebMercator"&gt;esri.geometry.geographicToWebMercator()&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2012 16:23:43 GMT</pubDate>
    <dc:creator>derekswingley1</dc:creator>
    <dc:date>2012-02-01T16:23:43Z</dc:date>
    <item>
      <title>Can't get correct extent on World Stree Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85438#M7740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm a beginner to the ESRI API and scripting in general. I'm trying to make a basic web map with the World_Street_Map layer but the extent I use shows "no map data available" because it's off in the ocean on the wrong side of the world! If I use that same extent (same x y coordinates) with the ESRI_StreetMap_World_2D layer it works fine though. Can anyone give me some advice on what I'm missing? Any help would be appreciated because I'm stuck right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Here's the code for the test that uses the World_Street_Map (the one that's not working)...&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var startExtent = new esri.geometry.Extent(-95.4, 40.887, -94.908, 41.171,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.SpatialReference({wkid:102100}) );&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap = new esri.Map("mapDiv", { extent: startExtent });&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; var mapServiceURL = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" rel="nofollow" target="_blank"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer&lt;/A&gt;&lt;SPAN&gt;";&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap.addLayer(new esri.layers.ArcGISTiledMapServiceLayer(mapServiceURL));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Here's the code for the test that uses the ESRI_StreetMap_World_2D layer (the one that works fine)...&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function init() {&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var startExtent = new esri.geometry.Extent(-95.4, 40.887, -94.908, 41.171,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esri.SpatialReference({wkid:4326}) );&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap = new esri.Map("mapDiv", { extent: startExtent });&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; var mapServiceURL = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" rel="nofollow" target="_blank"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer&lt;/A&gt;&lt;SPAN&gt;";&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap.addLayer(new esri.layers.ArcGISTiledMapServiceLayer(mapServiceURL));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 15:53:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85438#M7740</guid>
      <dc:creator>PatrickBinns</dc:creator>
      <dc:date>2012-02-01T15:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get correct extent on World Stree Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85439#M7741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The World_Street_Map service has a spatial reference of 102100 (Web Mercator) and the coordinates that you supply are in geographic (4326). You can resolve the problem by specifying your extent in geographic then using esri.geometry.geographicToWebMercator to convert the coordinates. Here's a code snippet that shows this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var initExtent = new esri.geometry.Extent({"xmin":-122.46,"ymin":37.73,"xmax":-122.36,"ymax":37.77,"spatialReference":{"wkid":4326}});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map = new esri.Map("map",{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extent:esri.geometry.geographicToWebMercator(initExtent)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:17:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85439#M7741</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-10T23:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get correct extent on World Stree Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85440#M7742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The conceptual help topic &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/intro_extents.htm"&gt;Working with Extents&lt;/A&gt;&lt;SPAN&gt; is worth a read.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your example that doesn't work, you're specifying what looks like lat, long coordinates but saying the spatial reference is web mercator (wkid 102100). If you want to create an extent as lat, long but apply it to a map service that uses webmercator, create the extent as lat, long (wkid 4326) and convert it to webmercator using &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/namespace_geometry.htm#geographicToWebMercator"&gt;esri.geometry.geographicToWebMercator()&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 16:23:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85440#M7742</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-02-01T16:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get correct extent on World Stree Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85441#M7743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you both Kelly and swingley! With your explanation I'm now able to get it to work properly. Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 17:09:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85441#M7743</guid>
      <dc:creator>PatrickBinns</dc:creator>
      <dc:date>2012-02-01T17:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get correct extent on World Stree Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85442#M7744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to help! You should mark Kelly's post as an answer, she was first &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 17:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-t-get-correct-extent-on-world-stree-map/m-p/85442#M7744</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-02-01T17:17:02Z</dc:date>
    </item>
  </channel>
</rss>

