This section provides a venue for sharing GIS-related programming code and custom scripts in a variety of languages. Posts can be viewed by category or as a whole in blog format (below).
This label expression can be used to display long text strings from an attribute field as a multi-line label. Basically it attempts to add hard returns (line breaks) after every other word.
For example, the script will display the value "Western Washington County Special Service District 1, Pine Valley" as:
Western Washington County Special Service District 1, Pine Valley
There are three parameters to keep in mind.
The input field name, currently set to [Name] in the code below. Change this in two places to the field from which you would like to get the label string.
MaxWordLength, currently set to 10, change this to force long words onto their own line like 'Washington' in the example above
MixWordLength, currently set to 3, change this to keep short words from being put on the next line like '1,' in the example above
When using a label expression, you'll need to click the expression button on the label properties window and then click the advanced button. Delete the suggested code and replace it with the code below.
If you ever need to do repetitive work then you can either code each operation one after the next which can make your script really long winded, or you can make your code more efficient by utilizing functions. The code below has a dictionary containing a whereclause for each desired output layer. I could code something like this:
make feature layer1
kernel density from lyr1
make feature layer2
kernel density from lyr2
make feature layer3
kernel density from lyr3
etc
etc
etc...
A "cleaner" approach is use something like the code below, which passes each key and value from a dictionary that consist of the output hotspot rasters-to-be's name, and the whereclause that subsets the data from a master Feature Class.
When playing with AGS 9.3, firebug for Firefox , and fiddler for IE I realized that the esri:FloatingPanel control carries along a lot of baggage with it. Not only are the esri:FloatingPanels strictly asynchronous, every time you hide/show a panel with javascript, in our case 26KB of the contents of your FloatingPanel are sent from the client to server to maintain session state. Depending how much content you have in your FloatingPanel the overhead could make your application unusable for slower internet users.