<?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: My First Custom Widget (WIP) : Rubber Band Zoom in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834096#M8593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is gorgeous...&lt;/P&gt;&lt;P&gt;I also think I understand the majority of the code. Altho, I am more confused by the config stuff versus the javascript!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be involved if I wanted to make this visible underneath the MyLocation button? It appears that those buttons are scaled/sized differently than the buttons across the bottom?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, (trying to learn as much as I can here!) could I just make this a 'generic' button (unconnected to top or bottom widget groups) and allow the user to add it from the WAB so that it sized itself correctly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Nov 2014 15:56:49 GMT</pubDate>
    <dc:creator>BrianO_keefe</dc:creator>
    <dc:date>2014-11-17T15:56:49Z</dc:date>
    <item>
      <title>My First Custom Widget (WIP) : Rubber Band Zoom</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834094#M8591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alrighty...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm wanting to 'tentatively' step into custom widget design. I still have a VERY difficult time grasping the Dojo Modules concept, but what I want to do shouldn't require that. So...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a new widget, I called it (ingeniously enough) "MagnifyingGlass" because that's what the end users want.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have copied from the WAB Sample Widget the SimpleWidget folder structure for the 'Get Map Id' widget example.&lt;/LI&gt;&lt;LI&gt;I have renamed everything.&lt;/LI&gt;&lt;LI&gt;I have added it to the site config file so that it shows up.&lt;/LI&gt;&lt;LI&gt;It is now visible on one of my &lt;A href="http://maps.cityoftulsa.org/jsdev/iot/"&gt;dev maps&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;It is the button that is a Duplicate of the BOOKMARK widget button, in the bottom left set of 4 buttons.&lt;OL&gt;&lt;LI&gt;If you hover over it it says 'Zoom'&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is what happens when you click it!&lt;/P&gt;&lt;P&gt;It opens a friggin window? Popup...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want it to do is simply "this.map.enableRubberBandZoom();" and nothing more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole goal for this widget is to simply add a button that users can click that lets them THEN click and drag to draw a Zoom window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apparently, this is functionality that SHOULD be (obviously) on all maps. SO...&lt;/P&gt;&lt;P&gt;In my Widget.js file (remember I copied the Simple Widget example files) I have commented out the templateString, rewrote _getMapID to now be _init simply because I don't know what I'm doing (and I'm not sure where to look).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole goal is the Rubber Ban Zoom Box creation after clicking the Widget button. Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any tips?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps I'll post this widget in case anyone has a need (once I get it finished and working).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 20:04:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834094#M8591</guid>
      <dc:creator>BrianO_keefe</dc:creator>
      <dc:date>2014-11-14T20:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: My First Custom Widget (WIP) : Rubber Band Zoom</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834095#M8592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Having a widget just launch some code and not have a UI is not a common practice (wasn't in Flex either). There is just nothing setup for this OTB. You will have to manually handle things like a UI widget does. Here is your code updated to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The big thing is the inPanel - false part and then handling all the UI dom stuff yourself since you are not wanting a panel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the json code for you main config.json file (of course you might need to change the left and bottom values):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14162373551871062 jive_text_macro" jivemacro_uid="_14162373551871062"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "position": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "left": 205,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "bottom": 155&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "widgets/MagnifyingGlass/Widget_10_13",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "positionRelativeTo": "map",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": "Zoom In",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "label": "Zoom In",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uri": "widgets/MagnifyingGlass/Widget"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 15:17:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834095#M8592</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-11-17T15:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: My First Custom Widget (WIP) : Rubber Band Zoom</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834096#M8593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is gorgeous...&lt;/P&gt;&lt;P&gt;I also think I understand the majority of the code. Altho, I am more confused by the config stuff versus the javascript!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be involved if I wanted to make this visible underneath the MyLocation button? It appears that those buttons are scaled/sized differently than the buttons across the bottom?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, (trying to learn as much as I can here!) could I just make this a 'generic' button (unconnected to top or bottom widget groups) and allow the user to add it from the WAB so that it sized itself correctly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 15:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834096#M8593</guid>
      <dc:creator>BrianO_keefe</dc:creator>
      <dc:date>2014-11-17T15:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: My First Custom Widget (WIP) : Rubber Band Zoom</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834097#M8594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Because this is a UI (on screen) type of widget and it is not part of the WAB widget manifest you are not adding this as you would OTB widget in WAB. you are adding it manually to the main config.json of your app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Making it appear under your location widget would be as simple as adjusting the position constraints (top or bottom, left or right) in your main config.json. Adjusting the size to match the my location widget would be simply changing the pnode div size in the widget.js code by adding a style attribute.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 16:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834097#M8594</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-11-17T16:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: My First Custom Widget (WIP) : Rubber Band Zoom</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834098#M8595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want your widget to appear in every app that you produce using WAB then you can add it as a default widget by adding it to the client\builder\predefined-apps\default2DApp\config.json right after the MyLocation widget object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14162430840758703 jive_text_macro" jivemacro_uid="_14162430840758703" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uri": "widgets/MagnifyingGlass/Widget",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "position": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "left": 7,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "top": 145&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 16:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/my-first-custom-widget-wip-rubber-band-zoom/m-p/834098#M8595</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-11-17T16:51:28Z</dc:date>
    </item>
  </channel>
</rss>

