Click here to access the live application.
Click here to download the source code.
One of the motivations of gaming is the thrill of competition, whether personally or with others. In order to identify users so that they could monitor their scores, or those of others, there needed to be some sort of authentication. The obviously choice is AGOL. AGOL is the perfect choice when collaboration is needed within the GIS community but a large percentage of the target audience of this application may not have AGOL credentials. Arguably, Facebook may not be completely ubiquitous but certainly common. As such, we decided to use Facebook and the Facebook API to authenticate users. To ease privacy concerns this application requests and displays only a small subset of profile information, specifically, a person's profile picture, last name and initial of first name.
Controlling Access to Hosted Services
The game's questions, answers and scores are stored in two ArcGIS Online hosted feature services. Hosted services are easy to create and allow for powerful spatial queries. However access to hosted service is either unrestricted, or confined to an organization or to users that belong to specific groups. Because this game is intended for non-AGOL users, we needed a way of restricting access to the hosted services to just the Map Quiz web application.
This was achieved by registering the app on AGOL. The resulting app id and secret were then used in a web proxy that granted exclusive access to the hosted services to only the Map Quiz web application. The proxy and instructions how to implement it are here.
As mentioned above, this project is based on a few open source libraries, these libraries are listed and described below.