Combining the out-of-the-box NearMe and Query widgets

9100
9
03-28-2017 11:21 PM
CameronBlandy
Occasional Contributor

Was wondering how one go about starting to create a custom widget that has both the NearMe and Query widget embedded? I assume I do not have to copy all of the code from both of the aforementioned widgets into my custom widget. How do I reference the two widgets in my custom widget?

I would like to place the custom widget into the side panel of the Jewelry Box theme.

Note: The NearMe widget itself has the search widget combined with a spatial buffer search.

Any tips greatly appreciated.

Regards,

Cameron

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus

Cameron,

   It will be now where close to that simple. Attempting to combine both widgets means combing both UIs and code base the new Widgets.js and Widget.html and will lead to many hours/days of re-development. You best option is to group the widgets in the Jewelry Box theme header controller. The Jewelry Box theme widget drawer is designed for one one widget so it does not allow for grouping of widget like the headercontroller does.

0 Kudos
CameronBlandy
Occasional Contributor

Hi Robert,

Thanks for your valuable input. I would, then like to modify my question. If I put the NearMe and Query widgets in the header controller how hard would it be to put the results from those two widgets into the side drawer. I’d like to have one result set that looks identical..

Cameron

CAMERON BLANDY | GIS ANALYST

GIS Section

13450 104 Ave, Surrey, BC, V3T 1V8

T 604.591.4699 | F 604.598.5781 |www.surrey.ca

<http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey>

Connect, Share and Engage with your City

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cameron,

   Might actually be a higher level of effort then I previously warned of. The results are part of each one of those widgets code base and not designed to be displayed in another widget.

0 Kudos
CameronBlandy
Occasional Contributor

Thanks again for your honesty and expertise. I need to justify development time with cost saving (as is always the case). Might have to provide slightly less functionally out-of-the-box but saving significant costs.

CAMERON BLANDY | GIS ANALYST

GIS Section

13450 104 Ave, Surrey, BC, V3T 1V8

T 604.591.4699 | F 604.598.5781 |www.surrey.ca

<http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey>

Connect, Share and Engage with your City

0 Kudos
CameronBlandy
Occasional Contributor

Hi Robert,

I am trying to combine the widgets which proving to be difficult as there are duplicate functions that I need to merge.

I am new to using WAB developers edition. I tried to make a test widget just to get my feet wet. I did it the sample widgets folder and got to work. I copied it to the stemapp/widgets folder and ran the setup.exe. I tried to load my widget and got an error (nothing in the console log to help). I determined that the config.json had some errors. I corrected the errors and ran the setup.exe again, however when adding the widget I get the same error and I notice that it is still trying to use the old config.json. I have tried it in 3 different browsers and cleared the cache on all three but no luck.

Do you have any idea what might be causing this?

Cameron

CAMERON BLANDY | GIS ANALYST

GIS Section

13450 104 Ave, Surrey, BC, V3T 1V8

T 604.591.4699 | F 604.598.5781 |www.surrey.ca

<http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey>

Connect, Share and Engage with your City

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cameron,

  You have me confused with the mention of setup.exe as WAB nor widgets have a setup.exe. When a widget is added to an app the widgets config file that it is using is saved in the apps main config.json file i.e.:

{
"position": {
"left": 55,
"top": 45,
"relativeTo": "map"
},
"placeholderIndex": 1,
"id": "_5",
"name": "eSearch",
"uri": "widgets/eSearch/Widget",
"config": "configs/eSearch/config_eSearch.json",
"openAtStart": true,
"icon": "widgets/eSearch/images/icon.png?wab_dv=2.4",
"version": "2.4"
},

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Robert, I think Cameron means they are using the startup.exe to start the nodejs/WAB dev edition.  ...Just to rule that out.

CameronBlandy
Occasional Contributor

Yes that was what I meant. The developers edition didn’t seem to incorporate the changes I made to the config file.

UPDATE. If you create a new app then it will “see” the new changes….

CAMERON BLANDY | GIS ANALYST

GIS Section

13450 104 Ave, Surrey, BC, V3T 1V8

T 604.591.4699 | F 604.598.5781 |www.surrey.ca

<http://www.surrey.ca/12392.aspx>[Social Media Icons_City Speaks_GREEN]<https://www.cityspeaks.ca/Portal/default.aspx> <https://twitter.com/cityofsurrey> <https://www.facebook.com/TheCityofSurrey> <http://www.youtube.com/TheCityofSurrey> <http://www.linkedin.com/company/city-of-surrey>

Connect, Share and Engage with your City

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cameron,


  As I mentioned in my last reply you need to check the path to the config file that the widget is using because the widget normally does not use the config.json from the widget folder once a change has been made to the widgets settings dialog. Widget config files are saved to the apps config/widgetName/widgetName_config.json

0 Kudos