Forms Designer - Crop History Controls

Modified on 2015/05/14 22:55 by Adam — Categorized as: Uncategorized

Place one or more maps on a form that shows a specified year from the CropScape, Crop History layer as well as the Legend showing what crops are being represented.

For Demonstration Purposes I will create a new form (File>New Custom Form) but this process can be done with any form's aerial map. 

Image

Start by placing 3 objects on the form; a Text Box, a Map, and a , and a Crop History Legend. 

Image

The placed Text Box will control which year's data is pulled from the Crop History Layer. Assign the Text box a name so it can be easily referenced. (CropYear1).

Image

It may be desired to automatically fill the crop year in with a previous year. (Remember: Crop History only is available from the previous crop year and older.) In order to accomplish filling in a previous year, we can use the @cropYear variable to find the selected crop year and then write a simple formula to subtract 1 or more from it. 

=@cropYear - 1

If you have multiple maps on one form that need to have different years shown, you will need a Text Box for each map and then subtract an amount from the first Text Box used.


In the case of the example, the formula would be 

=CropYear1-1
This way, if the year was changed for the first map manually, then it would change all other maps accordingly. 

Image

Now that there is a control to pull the year from, the Map and the Crop History Legend can be configured properly.

Change the Crop History Year Control for both the Map AND the Crop History Legend items to the Text Box that will be showing the Crop Year (CropYear1). 

Image

Once you have that set, Save your Form (File>Save or Save As) and Release (or Publish if the form has already been released) it to your account. 

Image

Pull up the form from your account. 

Image

When the year is changed within that text box that controls the map, then that map is refreshed to the different year for the Crop History layer automatically. 

Image

See Also: