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
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.
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?
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?
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.
On my sites i have anywhere from 1 to 4 filters.