Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (64 sloc) 1.89 KB
title: Mapping Example
name: Quinten Steenhuis
organization: Greater Boston Legal Services
comment: |
This interview demonstrates Docassemble's Google Maps integration and importing
a custom module.
In this example, the module implements Social Security Administration's office locator
API and creates a simple Docassemble object that represents a list of "nearest"
By default, it will iteratively load a minimum of 3 offices. Try putting an address in
Nome, Alaska to see how big the map can get.
It also demonstrates the Address object and the Person object, as well as using a
for loop to display the contents of a list.
- docassemble.ssa.ssa
- officelist: FieldOfficeList
- my_address: Address
comment: |
This block controls question order.
mandatory: True
code: |
comment: |
This block fills in the "officelist" object with the results of the SSA API
lookup, using the custom docassemble.ssa module.
code: |
officelist.gathered = True
question: |
Your address
- Address: my_address.address
address autocomplete: True
- City:
- State: my_address.state
- Zip:
comment: |
The map_of function uses Google Maps to map a list of addresses (or Persons/Individuals
with addresses).
officelist is a special object type. To get map_of to understand it, we need
to tell it to treat it like a regular list of Persons by casting it to list()
event: display_offices
question: |
Nearest Offices
subquestion: |
The offices closest to ${my_address.on_one_line()} are shown below.
% for office in officelist:
* ${office}
* ${office.address.on_one_line()}
% endfor
You can’t perform that action at this time.