ModifiedWeather.zip

2454
4
01-23-2018 11:09 AM

ModifiedWeather.zip

Christopher thank you for your weather widget, I love it great idea, I also wanted to be able to pull the weather from any where, here is a modified version of your widget where I added a  button and coordinates and a couple functions to call for weather at the location, I don't have much time to spend on it right now but thought I would share with you in case its of some use to you for future versions you may be creating.

Attachments
Comments

This is really good, thank you for this. Any chance of adding a 'clear results' button (when you have some time) in order to clear the coordinates and remove the icon from the map?

William,

Thanks for the edits and feedback!

I made a few edits:

1. The widget panel would still open to the default size witch is not great for viewing the nws.gov site. I modified the js file to automatically resize the widget to a better size.

        onOpen: function () {
            //Resize the Panel when opened. By: Robert Scheitlin
            //GeoNet post: https://geonet.esri.com/thread/181865-how-to-change-wab-widget-window-size
            var panel = this.getPanel();
            panel.position.width = 600;
            panel.setPosition(panel.position);
            panel.panelManager.normalizePanel(panel);
        },

2. I added a command to remove the weather graphic from the map when the widget is closed.

        onClose: function () {
            this.mapPinsGraphicsLayer.remove(graphic); //new addition
           // this.map.graphics.remove(graphic); // old version
            var thePanel = this.getPanel();
            console.log(thePanel);
        }‍‍‍‍‍‍

If you want, I can post your modified version of the widget as an update to the original (version 1.2) and credit you for the update, or you can maintain this separate widget and I can provide a link to it in the description for the weather widget. Let me know.

Thanks again! 

Chris

Chris, I wouldn't  post anything seperate, you can include whatever you want to in your widget from whatever changes I made no need to credit me just wanted to share it with you and glad you can make some use of it.   If I have any other ideas or changes I'll share them but I'm pretty happy with what I have now.

Thanks again!

Version history
Last update:
‎01-23-2018 11:09 AM
Updated by:
Contributors