<?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: Esri JS API 4.7 - Changing the view spatial reference in place in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553810#M51673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2906"&gt;Bjorn Svensson&lt;/A&gt;‌ Thanks for clarifying. I just found it strange that one can actually set the spatialReference of a view by doing (e.g.) "view.spatialReference = 4326" and the viewpoint then throws strange errors in the console because it is not recognizing the same SR anymore. However, this is certainly something I can live with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2018 07:41:18 GMT</pubDate>
    <dc:creator>AlessandroValra</dc:creator>
    <dc:date>2018-06-20T07:41:18Z</dc:date>
    <item>
      <title>Esri JS API 4.7 - Changing the view spatial reference in place</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553808#M51671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to change the view.spatialReference property in place to be able to switch between basemaps with different spatial reference.&lt;/P&gt;&lt;P&gt;All the basemaps I use should be of type TileLayer.&lt;/P&gt;&lt;P&gt;I can actually do what I want if initialize a new view with the spatial reference I want and then add the new basemap.&lt;/P&gt;&lt;P&gt;However, I'd like to do it witout recreating the view from scratch if possible.&lt;/P&gt;&lt;P&gt;Something like doing "view.spatialReference: 32632" or similar with the extent property.&lt;/P&gt;&lt;P&gt;The problem is, when I do it, the console raises an viewpoint error and I don't know how to handle it.&lt;/P&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;[esri.views.MapView] #viewpoint incompatible spatialReference {"latestWkid":3857,"wkid":102100} with view's spatialReference {"wkid":32632}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to reinizialize the viewpoint when the view changes? I don't see in the docs any reference to setting the spatialreference for the viewpoint, I guess this is set internally when the view is inizialized and this gets the app confused when changing the spatial reference of the view, while its viewpoint "remembers" it as the old one...&lt;/P&gt;&lt;P&gt;I am aware that &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#overview"&gt;the viewpoint overrides the extent property&lt;/A&gt; in the view class.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/umbe1987/pen/xzrgpx?&amp;amp;editors=100"&gt;Here&lt;/A&gt; is the codepen example to hopefully make you understand better my problematic.&lt;/P&gt;&lt;P&gt;Just, be aware that the above example may work or not depending on your browser (I am using FireFox and it works for instance).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 10:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553808#M51671</guid>
      <dc:creator>AlessandroValra</dc:creator>
      <dc:date>2018-06-13T10:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Esri JS API 4.7 - Changing the view spatial reference in place</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553809#M51672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;No, there isn't currently a way to reinitialize the viewpoint when the view changes.&amp;nbsp; However, it's something we would like to support in the future.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2018 18:30:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553809#M51672</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2018-06-19T18:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Esri JS API 4.7 - Changing the view spatial reference in place</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553810#M51673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/2906"&gt;Bjorn Svensson&lt;/A&gt;‌ Thanks for clarifying. I just found it strange that one can actually set the spatialReference of a view by doing (e.g.) "view.spatialReference = 4326" and the viewpoint then throws strange errors in the console because it is not recognizing the same SR anymore. However, this is certainly something I can live with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 07:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-4-7-changing-the-view-spatial/m-p/553810#M51673</guid>
      <dc:creator>AlessandroValra</dc:creator>
      <dc:date>2018-06-20T07:41:18Z</dc:date>
    </item>
  </channel>
</rss>

