Collections

:earth_americas: :earth_africa: :earth_asia:

## Issues
* There is high coupling between ```MapView``` and ```Visualization```, however it can be argued that Visualizations are only useful with a MapView. In addition, because Visualizations communicates through a well-defined interface the state of the MapView is encapsulated.
* Decouple ```MarkerView``` and ```InfoWindowView```. An InfoWindowView can be opend above the MarkerView, by specifying it as a parameter in the ```#open``` invocation.

## TODO
### Collections bound to a Location
It is important to separate the ```MapView``` from any understanding of what form the content being displayed takes (i.e. An entire Collection vs. a single piece of content from that collection). Thoughts on how to achieve this:
* When defining sources of content
 * Do not specify the type of visualization to be used
 * For sources of content which must be explicitly bound to a location
  * Ability to supply the geographic context of the content (e.g. Lat/Lon coordinate, ISO code, etc.)
```
var sourceToLocationMappings = [ { source: col1, location: [myLat, myLon] }, ... ]
```
 * ```MapView``` must have the ability to observe the sources of content and identify each source's geographic context defined previously.
  * At run-time, the type of visualization is declaratively chosen by means of a method invocation.

### Types of Visualizations
In [Thematic Theming](http://en.wikipedia.org/wiki/Thematic_map) there are a few common techniques to visualize a dataset in relation to some geographic context. A subset of these techniques are relevant to social content that encodes its geographic context by ways of a geotagged latitude-longitude coordinate:

 * Choropleth --> Content-to-Location, Collection-to-Location
 * Proportional symbol (bubbles) --> Content-to-Location, Collection-to-Location
 * Dot --> Content-to-Location, Collection-to-Location

The [Datamaps](http://datamaps.github.io/) library has observed this and offers the ability to render data onto a map in a similar set of techniques:

 * Choropleth
 * Bubbles
 * Animated Arcs

All of which are visualized on a 2D projection of the Earth.

It would be wise to observe these techniques of visualizations and enable the ```MapView``` to have a similar interface that allows for a run-time declarative interface to render the data in one of these techniques.

## Current State
### Overlays
The Overlays API is simple. To add an overlay to be drawn on the ```MapView```:
* Use the ```#addOverlay``` method. It expects an ```OverlayView``` instance.

### Overlay Views
There are two concrete ```OverlayView```s
* ```MarkerView```: produces a dot on the map representing a ```Point``` in the map's coordinate system.
* ```SolarTerminatorOverlayView```: An animated overlay view that draws the solar terminator of the Earth. It is updated every 60 seconds.

### Visualizations
The Visualizations API is simple. To add a visualization, implement a concrete ```Visualization``` and register it with the ```MapView``` via:
* The ```#_addVisualization``` method. It expects two arguments
 1. ```name```: The name of the property to register on the ```MapView``` prototype. (e.g. mapView.chropleths())
 1.  ```visualization```: The ```Visualization``` instance.

### Data to Location
The Data-to-Location API is simple. Data can consist of a single ```Content``` item or a ```Collection``` of a set of Content. To explicitly map a data source to a location:
* Use the ```#addDataPoint``` method. It expects two arguments
 1. ```data```: The ```Collection``` or ```Content``` instance
 1. ```location```: A ```Point``` instance that refers to a Lat/Lon coordinate or a ISO Code of the administrative region.