WAB - Date range picker

14207
23
05-27-2015 02:59 PM
StanMcShinsky
Occasional Contributor III

Does anyone have a widget that allows you to pick a date range from a calender to limit features on the map? For example I want to have some crime data on a map and have the user select a date range to show on the map. It would also then be nice to make it work with a chart widget.

Thanks for any help.

-Stan

0 Kudos
23 Replies
RobertScheitlin__GISP
MVP Emeritus

Rickey,

  The filterLayer = lLayer; set the local var of filterLayer to the current layer the widget is configuring and this var is used by the applyFilter function to set the definition for that layer based on the current filter settings. I would get the layer from the map based on the selected tab.  Something like this._viewerMap.getLayer(the layers name); maybe in a function like this:

      getCurrentSelectedFilterLayer: function(layerName){
        return this._viewerMap.getLayer(layerName);
      },

That way you can call it from the applyFilter function. Or even better use the function to set the filterLayer to the proper layer when the tab is changed.

0 Kudos
ChelseaRozek
MVP Regular Contributor

I've customized Rickey's filter widget for my webmap and it works well, but instead of bringing in a new layer, can I run the filter on a layer already in my webmap? I tried using the code you gave above to get the layer by name, but couldn't get it to work.

I created the webmap via ArcGIS Online and am using Web AppBuilder to customize the viewer and widgets.  Is this something that would be specified in the config.json instead?

0 Kudos
SethLewis1
Occasional Contributor III

Coming back to this discussion many months on.

Stan, Rickey:

Have either of you had success with further development of a date picker/floor switch widget?

0 Kudos
RickeyFight
MVP Regular Contributor

Seth,

In short yes.

It was developed mostly for WAB 1.1 though and has not been updated since.

Here is the code if you want to use it and update to 1.3

daFiter/localLayer_filter · GitHub

Here is a demo.

ArcGIS Web Application

On my sites i have anywhere from 1 to 4 filters.