<?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: custom Zoom button in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1293692#M6622</link>
    <description>&lt;P&gt;Okay,&amp;nbsp; im going to add a bit more information.&amp;nbsp; I'm thinking this 'may' be a structure/scope issue within the HTML/js because im having trouble finding the "view".&amp;nbsp;&amp;nbsp; keep getting errors.. I know it's there, but I can't seem to access it.&amp;nbsp;&amp;nbsp;&amp;nbsp; again,&amp;nbsp; just trying to add a 'button' and have it zoom in just like the standard ESRI ui zoom controls.&lt;/P&gt;&lt;P&gt;anyways,&amp;nbsp; here's the important bits of what ive got and hoping you'all can help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [-100.0, 40.0], // longitude, latitude&lt;BR /&gt;zoom: 3,&lt;BR /&gt;padding: {&lt;BR /&gt;left: 45&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;function zoomin() {&lt;BR /&gt;document.getElementById('zoominbtn')&lt;BR /&gt;console.log('console log')&lt;BR /&gt;var n = view.zoom + 1;&lt;BR /&gt;view.zoom = n;&lt;BR /&gt;};&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button id="zoominbtn" class=zoominbtn onclick="zoomin()"&amp;gt;&lt;BR /&gt;&amp;lt;img src="images/zoom-in-svgrepo-com.svg"width="24" height="24"&amp;gt;&amp;lt;/button&amp;gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 21:51:03 GMT</pubDate>
    <dc:creator>Paco</dc:creator>
    <dc:date>2023-05-26T21:51:03Z</dc:date>
    <item>
      <title>custom Zoom button</title>
      <link>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1293182#M6618</link>
      <description>&lt;P&gt;Hello all!&amp;nbsp;&amp;nbsp; I'm trying to create custom zoom buttons within my Webapp.&lt;/P&gt;&lt;P&gt;I've created simple Div/Buttons with HTML/CSS and would like to simply click and zoomin/zoomout at the standard MapView 'zoom' levels.&lt;/P&gt;&lt;P&gt;the usual code has been added but I will need to reference the click on the Button and zoom the view.&amp;nbsp; any help?&amp;nbsp; thanks! Screenshot included.&amp;nbsp; Javascript 4.x&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [-100.0, 40.0], // longitude, latitude&lt;BR /&gt;zoom: 3,&lt;BR /&gt;padding: {&lt;BR /&gt;left: 45&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;div id="myleftnav" class="leftnav"&amp;gt;&lt;BR /&gt;&amp;lt;button type="button" class=zoominbtn&amp;gt;+&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;button type="button" class=zoomoutbtn&amp;gt;-&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 17:32:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1293182#M6618</guid>
      <dc:creator>Paco</dc:creator>
      <dc:date>2023-05-25T17:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: custom Zoom button</title>
      <link>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1293692#M6622</link>
      <description>&lt;P&gt;Okay,&amp;nbsp; im going to add a bit more information.&amp;nbsp; I'm thinking this 'may' be a structure/scope issue within the HTML/js because im having trouble finding the "view".&amp;nbsp;&amp;nbsp; keep getting errors.. I know it's there, but I can't seem to access it.&amp;nbsp;&amp;nbsp;&amp;nbsp; again,&amp;nbsp; just trying to add a 'button' and have it zoom in just like the standard ESRI ui zoom controls.&lt;/P&gt;&lt;P&gt;anyways,&amp;nbsp; here's the important bits of what ive got and hoping you'all can help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [-100.0, 40.0], // longitude, latitude&lt;BR /&gt;zoom: 3,&lt;BR /&gt;padding: {&lt;BR /&gt;left: 45&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;function zoomin() {&lt;BR /&gt;document.getElementById('zoominbtn')&lt;BR /&gt;console.log('console log')&lt;BR /&gt;var n = view.zoom + 1;&lt;BR /&gt;view.zoom = n;&lt;BR /&gt;};&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button id="zoominbtn" class=zoominbtn onclick="zoomin()"&amp;gt;&lt;BR /&gt;&amp;lt;img src="images/zoom-in-svgrepo-com.svg"width="24" height="24"&amp;gt;&amp;lt;/button&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 21:51:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1293692#M6622</guid>
      <dc:creator>Paco</dc:creator>
      <dc:date>2023-05-26T21:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: custom Zoom button</title>
      <link>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1295853#M6631</link>
      <description>&lt;P&gt;I'll answer my own question &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; after a several days of trial and error,&amp;nbsp; a custom zoom button:&lt;/P&gt;&lt;DIV&g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&gt;zoom&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;n&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 05 Jun 2023 16:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/custom-zoom-button/m-p/1295853#M6631</guid>
      <dc:creator>Paco</dc:creator>
      <dc:date>2023-06-05T16:08:25Z</dc:date>
    </item>
  </channel>
</rss>

