<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">There is a DragRotateAndZoom example:<br>
      </div>
      <div class="moz-cite-prefix"><a class="moz-txt-link-freetext" href="https://openlayers.org/en/latest/examples/drag-rotate-and-zoom.html">https://openlayers.org/en/latest/examples/drag-rotate-and-zoom.html</a></div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">Take this and replace
        DragRotateAndZoom with DragZoom passing {condition: () =>
        true} in the constructor:</div>
      <div class="moz-cite-prefix">
        <pre class="language-js line-numbers" style="box-sizing: border-box; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 14px; margin: 0.5em 0px; overflow: auto; display: block; color: black; border: 1px solid rgb(238, 238, 238); border-radius: 0px; background: rgb(255, 255, 255); text-shadow: white 0px 1px; text-align: left; white-space: pre; word-spacing: 0px; word-break: normal; overflow-wrap: normal; line-height: 1.5; tab-size: 4; hyphens: none; padding: 1em 1em 1em 3.8em; position: relative; counter-reset: linenumber 0; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code id="example-js-source" class="language-js" style="box-sizing: border-box; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 1em; color: black; overflow-wrap: normal; word-break: normal; background: none; text-shadow: white 0px 1px; text-align: left; white-space: inherit; word-spacing: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative;"><span class="token function" style="box-sizing: border-box; color: rgb(221, 74, 104);">defaultInteractions</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">(</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">.</span><span class="token function" style="box-sizing: border-box; color: rgb(221, 74, 104);">extend</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">(</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">[</span><span class="token keyword" style="box-sizing: border-box; color: rgb(0, 119, 170);">new</span> <span class="token class-name" style="box-sizing: border-box; color: rgb(221, 74, 104);">DragZoom</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">(</span></code><code id="example-js-source" class="language-js" style="box-sizing: border-box; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 1em; color: black; overflow-wrap: normal; word-break: normal; background: none; text-shadow: white 0px 1px; text-align: left; white-space: inherit; word-spacing: normal; line-height: 1.5; tab-size: 4; hyphens: none; position: relative;"><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">{condition: () => true}</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">)</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">]</span><span class="token punctuation" style="box-sizing: border-box; color: rgb(153, 153, 153);">)</span></code></pre>
      </div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">condition function gets called to
        decide if it should process the event - in your case it should
        always return true.<br>
      </div>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 12/01/2022 20:13, karsten wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2B06D5243CAC4183BB314732E584262F@terragispc">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      <meta name="GENERATOR" content="MSHTML 11.00.10570.1001">
      <div><font size="2" face="Arial" color="#000080"><span
            class="959430019-12012022">Hi All,</span></font></div>
      <div><font size="2" face="Arial" color="#000080"><span
            class="959430019-12012022"></span></font> </div>
      <div><font size="2" face="Arial" color="#000080"><span
            class="959430019-12012022">in OL 6 I would like to use a
            button so a user can click activate a change for
            the dragzoom control </span></font></div>
      <div><font size="2" face="Arial" color="#000080"><span
            class="959430019-12012022">so it will be available without
            holding down shift.</span></font></div>
      <div><font size="2"><font face="Arial"><span
              class="959430019-12012022"><font color="#000080">In </font></span><a
href="https://openlayers.org/en/latest/apidoc/module-ol_interaction_DragZoom-DragZoom.html"
              moz-do-not-send="true"><font color="#000080">https://openlayers.org/en/latest/apidoc/module-ol_interaction_DragZoom-DragZoom.html</font></a><font
              color="#000080"> <span class="959430019-12012022">it lists
                the option 'condition' to handles this.</span></font></font></font></div>
      <div><font size="2" face="Arial" color="#000080"><span
            class="959430019-12012022">I could not figure out how to
            change and set that condition . Any examples how to do this?</span></font></div>
      <div> </div>
      <div><span class="959430019-12012022"><font size="2" face="Arial"
            color="#000080">Thanks</font></span></div>
      <div align="left">
        <div><span style="FONT-SIZE: 11pt; FONT-FAMILY:
            'Verdana','sans-serif'"><font size="2" face="Arial"
              color="#000080">Karsten </font></span></div>
        <div><span style="FONT-SIZE: 11pt; FONT-FAMILY:
            'Verdana','sans-serif'"></span><span style="FONT-SIZE: 9pt;
            FONT-FAMILY: 'Verdana','sans-serif'"><br>
            <span style="COLOR: #003264"><font size="2" face="Arial"
                color="#000080">Terra GIS LTD<br>
              </font><a title="http://www.terragis.net/
                blocked::http://www.terragis.net/"
                href="http://www.terragis.net" moz-do-not-send="true"><font
                  title="http://www.terragis.net/" size="2" face="Arial"
                  color="#000080">www.terragis.net</font></a></span></span><!--?xml:namespace prefix = "o" 
ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p></div>
        <div align="left"> </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/openlayers-users">https://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Cordialement,
Momtchil Momtchev <a class="moz-txt-link-rfc2396E" href="mailto:momtchil@momtchev.com"><momtchil@momtchev.com></a></pre>
  </body>
</html>