<?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: Pinch to Zoom - Disable rotation on mobile device 4.3 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574260#M53652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an update to this, I was looking for a way to disable user rotation while still setting a rotation amount at the view level.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Working with Tech Support, credit to Mayur, we created a watch function where the if a user tries to rotate the map is returned to the view setting.&amp;nbsp; This has the effect of essentially disabling rotation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to watch any change in "rotation" property of view.&lt;BR /&gt; view.watch("rotation", function(norotate) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log(norotate);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;view.rotation = 289 // if this is hit set the rotation back to 289&lt;BR /&gt; }),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see result here,&amp;nbsp;&lt;A class="link-titled" href="https://gis.greenvillesc.gov/imaginefestival/index.html" title="https://gis.greenvillesc.gov/imaginefestival/index.html"&gt;https://gis.greenvillesc.gov/imaginefestival/index.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2018 15:25:27 GMT</pubDate>
    <dc:creator>deleted-user-OlpHy1NoMNug</dc:creator>
    <dc:date>2018-03-28T15:25:27Z</dc:date>
    <item>
      <title>Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574254#M53646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the ArcGIS API for JavaScript 4.3, when looking at a map on a mobile device, is it possible to configure the map or map view to not rotate when pinching to zoom?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Mar 2017 01:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574254#M53646</guid>
      <dc:creator>MattNicol</dc:creator>
      <dc:date>2017-03-04T01:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574255#M53647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;you can use:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #006a00;"&gt;// Disables map rotation&lt;/SPAN&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;view.constraints = {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; rotationEnabled: false&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your specific use case you would have to add the constraint using the view&amp;nbsp;pointer-down event and then on the&amp;nbsp;pointer-up you could remove the constraint.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Mar 2017 04:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574255#M53647</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-04T04:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574256#M53648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's perfect - thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Mar 2017 11:07:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574256#M53648</guid>
      <dc:creator>MattNicol</dc:creator>
      <dc:date>2017-03-04T11:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574257#M53649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also attempting to prevent map rotation on pinch zoom with JSAPI v4.3.&lt;/P&gt;&lt;P&gt;Finding that any use of the rotationEnabled constraint kills pinch zooming completely, which seems odd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried using rotationEnabled constraint property on creation of the MapView, also attempted Robert's suggestion of adding/removing constraint on view pointer-down/pointer-up events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'pointer-down'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;constraints &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotationEnabled&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'pointer-up'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;constraints &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotationEnabled&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Any ideas on why the rotationEnabled constraint would prevent pinch zooming?&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Thanks!&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Jared&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574257#M53649</guid>
      <dc:creator>JaredRowe</dc:creator>
      <dc:date>2021-12-12T00:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574258#M53650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think when you assign the new object you are clearing out the default constraints.&lt;/P&gt;&lt;P&gt;However, I am getting the same behavior (pinch zooming disabled) even when I do&lt;/P&gt;&lt;DIV style="color: #d4d4d4; line-height: 19px; font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-weight: normal; background-color: #1e1e1e;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;__esri&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;MapView&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;view&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;).&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;constraints&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;rotationEnabled&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 16:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574258#M53650</guid>
      <dc:creator>KiSungChon</dc:creator>
      <dc:date>2017-03-31T16:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574259#M53651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same problem since the version 4.3 of JSAPI, the pinch to zoom doesn't work if you disable the rotation option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround for the moment is :&lt;/P&gt;&lt;P&gt;1) Active rotationEnabled à true&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #9876aa;"&gt;constraints &lt;/SPAN&gt;: {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #9876aa;"&gt;rotationEnabled&lt;/SPAN&gt;: &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;true
&lt;/SPAN&gt;}&lt;/PRE&gt;&lt;P&gt;2) set rotation=0 for each pointer-up event&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;view = &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;new &lt;/SPAN&gt;MapView(*****)&lt;SPAN style="color: #cc7832;"&gt;;
&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="background-color: #344134;"&gt;view&lt;/SPAN&gt;.on(&lt;SPAN style="color: #6a8759;"&gt;'pointer-up'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-weight: bold;"&gt;function&lt;/SPAN&gt;(){&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #344134;"&gt;view&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;rotation &lt;/SPAN&gt;= &lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;;
&lt;/SPAN&gt;})&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;It works on mobile. It would&amp;nbsp;be nice if this option rotation will be separate from the zoom...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:43:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574259#M53651</guid>
      <dc:creator>StéphaneGuignard</dc:creator>
      <dc:date>2021-12-12T00:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pinch to Zoom - Disable rotation on mobile device 4.3</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574260#M53652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an update to this, I was looking for a way to disable user rotation while still setting a rotation amount at the view level.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Working with Tech Support, credit to Mayur, we created a watch function where the if a user tries to rotate the map is returned to the view setting.&amp;nbsp; This has the effect of essentially disabling rotation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to watch any change in "rotation" property of view.&lt;BR /&gt; view.watch("rotation", function(norotate) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;console.log(norotate);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;view.rotation = 289 // if this is hit set the rotation back to 289&lt;BR /&gt; }),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see result here,&amp;nbsp;&lt;A class="link-titled" href="https://gis.greenvillesc.gov/imaginefestival/index.html" title="https://gis.greenvillesc.gov/imaginefestival/index.html"&gt;https://gis.greenvillesc.gov/imaginefestival/index.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 15:25:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/pinch-to-zoom-disable-rotation-on-mobile-device-4/m-p/574260#M53652</guid>
      <dc:creator>deleted-user-OlpHy1NoMNug</dc:creator>
      <dc:date>2018-03-28T15:25:27Z</dc:date>
    </item>
  </channel>
</rss>

