This iBloc allows you to add a Google Map to a page. The map's default location can be determined via data flow, and it works well with the Locate Me iBloc.
A Google Map widget adds the following capabilities to an iRise simulation:
Easy insertion of a fully interactive Google Map onto a page
Ability to customize the default state of the Google Map using the Map Type and Zoom Level properties
Ability to bind the Address property to a data field so the map location can be changed dynamically by the reviewer
The Google Map widget can be configured to use input data or data stored in a datasheet. The better of the two approaches will depend on your business requirements.
You can find the geographic coordinates for a location when viewing a map on Google Maps by double-clicking the desired location on the map. The coordinates will appear in the search field.
Use the Google Map widget in tandem with the Locate Me iBloc to create an interaction in which reviewers can display their current location in the map.
This iBloc requires a live Internet connection to work.
Drag a Google Map widget to the page.
In the Properties panel, type an address, geographic coordinates or a place name in the Address field.
If desired, select the Show Pin checkbox.
Customize the default view of the map with the Map Type and Zoom Level fields.
When the Google Map widget loads in the browser, the location you specified in the Address field will be displayed. Any customizations you made in the Show Pin, Map Type and Zoom Level fields will be applied.
Setting the Map Address Dynamically
There are two methods of setting the value of the Address field dynamically in a simulation, both of which involve the use of data.
Follow these steps to capture user input and send it to the Address property of the Google Map widget:
Send data flow from a Text Input widget to the Clipboard (for more information on capturing user input data, see the iRise Help System).
Add a Google Map widget to the page and configure it to meet the needs of your simulation.
Add a Clipboard widget to the canvas.
Drag the Clipboard widget to the Google Map widget. The Select a Record or Field dialog box appears.
Select the data field you sent to the Clipboard in step 1 and click OK.
When the page is simulated in the Reader, the reviewer will be able to type a location into the Text Input widget. When the Submit Form action is triggered, the captured data will be sent to the Google Map widget and the map will display the specified location.
Follow these steps to use data in a datasheet to set the location of the Google Map widget:
Create a datasheet called LOCATIONS with two columns. Name the columns Location Name and Address.
Add two rows of sample data to the datasheet. In the Location Name column, add place names (e.g., Atlanta International Airport, iRise Headquarters). In the Address column, add complete or partial mailing addresses or geographic coordinates.
Add a Google Map widget to a page and configure it to meet the needs of your simulation.
On the same page, send the Location Name field from the LOCATIONS datasheet to a data table with one column (for more information about data tables, see the iRise Help System). Make sure Send clicked record to Clipboard is selected for the data table.
Connect the text placeholder in the data row to a Refresh link.
Add another Get LOCATIONS widget to the canvas, selecting Clipboard Record(s) in the Properties panel.
Drag the Get LOCATIONS widget to the Google Map widget. The Select a Field or Record dialog box appears.
Select the Address field and click OK.
When the page is simulated in the Reader, the records from the LOCATIONS datasheet are displayed in the data table. Clicking one of the Location Names will send that record to the Clipboard and refresh the page. After the page refreshes, the Address field in the Clipboard record is sent to the Address property of the Google Map widget, and the selected location is displayed in the map.
Tags a widget with a name that is referenced in Studio. It is never displayed in the browser.
Determines whether the widget is hidden in the browser by default (same as Hide in Browser for standard widgets).
Boolean value (true or false).
Centers the map at a specific location when it loads in the browser.
Text. Should be an address, place name or geographic coordinates. For more information about search parameters in Google Maps, click here.
Determines whether a pushpin icon will appear in the map.
Boolean value (true or false).
Determines which default view of the map will be displayed when the page loads in the browser.
Selection (roadmap, terrain, satellite or hybrid).
Determines the zoom level of the map when the page loads in the browser.
Integer from 0 to 19 (the higher the number, the higher the zoom level). A zoom level of 20 is possible in satellite view.
Note: To associate a data field with one of the properties listed above, click the small square to the right of the property field. The Set Property dialog will allow you to select a data field currently flowing into the widget.
Certain characters added to the Address property (such as parentheses) may cause an error when the Google Map widget loads in the browser.