Linguagens e Ambientes de Programação (2016/2017) [Eng.Inf. - DI/FCT/UNL]

Enunciado do 3º Projeto Prático (JavaScript)

Artur Miguel Dias


Important Dates


Changelog


Submission Rules

Special rules that apply to the submission of the assignment will be posted here in a date closer to the submission date.

Submission rules

GeoBrowser

Geocaching is an open-air fun activity with many adepts. This project consists in the development of a browser of geocaching data using some essential Web technologies. One of the goals is to exploit historical data and allow, for example, to observe the current situation at any time in the past. A file is provided with the historical geocaching data of the municipality of Almada.

There are some challenges: deal with a sophisticated JavaScript library (Leaflet) to handle geographic maps; work with HTML and HTML forms to create a graphical user interface; perform a bit of XML manipulation; work with classes and objects in JavaScript.

This project will be tested in the Firefox browser installed on the Linux of the labs. Note that there are some incompatibilities between different browsers on different platforms.

Note: Firefox is the best browser to develop the project because it supports access to local files via AJAX (cf. the end of lecture 21). Of course, when the system is finalized and deployed in a proper Web server, any client browser should be able to get the remote geocaching database.


What is Geocaching?

With the widespread use of GPS receivers, there are more and more games and activities taking advantage of the possibility of determining the coordinates of the current location. This promotes outdoor fun and physical activity for the whole family.

Here are some of these games and activities that use GPS: Geodashing, Degree Confluence Project, Benchmarking, Wherigo, Geocaching, Waymarking, Ingress, Pokémon GO.

As of now, Geocaching is the most popular GPS game with more than one million active players and more than three million geocaches worldwide. In Portugal there are 30000 players and 40000 geocaches available.

Geocaching consists in finding physical treasures (called geocaches or more simply caches) which are hidden in supposedly interesting locations. Some physical activity is often involved in reaching those locations. In English, the word "cache" is synonymous with "treasure", "hideout" and "stash".

A typical cache is a waterproof container containing a logbook and some small goodies that the visitor can exchange. The player discovers the container, signs the logbook, and hides back the container. Later, at home, the player writes an electronic log at the geocaching site to share their experiences with the others.

Sometimes hiding a treasure involves clever techniques so that the cache does not get stolen. For example: hide1, hide2, hide3.

Here is some vocabulary and concepts concerned with GeocaSching: cache kinds, cache sizes, difficulty/terrain (D/T), general glossary


Goals of the project

The aim is to develop an interactive a Web page to browse geocaching data. The page consists in two parts:

We offer, as a starting point, these two files: geo-browser.html and geo-browser.js. The HTML file includes the JavaScript file. These are the files you need to develop and submit in Mooshak before the deadline of the project.

We also offer a zip file containing the icons of the visual representation of the caches and a XML file containing the geocaching data of the municipality of Almada: resources.zip.

Create a folder containing the three files, expand the zip file, and you are ready to go. To get each of the three files, right-click and "Save link as...".


Available caches and archived caches

A cache is considered to have been archived on a date D if: (1) the "status" field of a cache is "A"; and (2) the date of the last log is D.

A cache is said to be available on a certain date D if: (1) it was published on D or before D; and (2) it was not archived on D or before D.


Functionalities

These are the required functionalities. Try to implement as many as possible and be ambitious in the aesthetics and in the sophistication of the control panel.

  1. There is a notion of reference date. The reference data is displayed in the control panel. The map only displays the caches that were available on the reference date. By default, the reference date is the date of today, but the user can select any other reference date in the past. Changing the reference date in the control panel causes the caches to be updated on the screen.

  2. There is an option in the control panel that makes the program display all the caches published before the reference date, even archived caches. Toggling this option in the control panel causes the caches to be updated on the screen.

  3. There is a filtering system in the control panel to allow the user to make visible in the map only the caches that correspond to the logic conjunction of four properties: (1) kind, (2) size, (3) difficulty, (4) terrain. For example, we may want to display only the caches such that, all at the same time: (1) kind is "traditional", "multi" or "mystery"; (2) size is "micro or "other"; (3) "difficulty" is above 3.5; (4) "terrain" is 1.5, 4 or 5. This filtering system acts only over the caches that were select for visibility by the two previous items. Changing one filtering option in the control panel causes the caches to be updated on the screen.

  4. There is an option in the control panel that enables automatic navigation in time, producing an animation effect in the map. The reference date advances automatically in response to the events of a timer and the caches in the map keep being updated accordingly. The automatic navigation stops when the date of today is reached or when the user disables the automatic navigation option.

  5. There is a small section in the control panel with some statistics about the caches currently displayed: for example, the number of caches currently displayed; the top 3 of the more prolific owners; the cache with highest altitude (note that the special altitude "-32768" means "altitude unknown"), etc.

  6. The popup balloon associated with each cache in the map presents in a very readable way most of the available information about that cache. One extra item of information is the number of neighbor caches visible in the map at the distance of 500 meters or less.

Beyond the required functionalities, everything you do to improve the program will be appreciated, for example trying to make the program faster and consuming less memory, or even adding some extra feature that proves to be useful. If you do any of this, please tell us about it the comment at the top of the JavaScript file.

When the program starts, the reference date is the date of today and all the options of the filtering system are setup in order to display all the available caches, but not the archived caches.


About the provided starting code

Read the commentaries added to the code in the file "geo-browser.js".



Project grading

The teachers responsible for the management and grading of this project are Artur Miguel Dias and Mário Almeida.

Around 80% of the grade will be assigned using objective criteria, considering only the execution of the program.

The remaining 20% will be assigned by checking out the quality of the code, including the following aspects:

It is not mandatory to complete all the functionalities. A partial implementation can be graded with a positive result.


Main rules


Other rules


Have fun!