mapbox/tm2 — pull request #418 by GretaCB (2014-06-05 23:21:48+00:00)
Title: UI addlayer updates

@samanpwbb @ajashton @ian29
Interested in your input before merging. Any thoughts, concerns, suggestions are greatly appreciated.

After integrating mapnik-omnivore into TM2, this allowed for simplifying how users add layers/files (KML, gpx, shape, CSV, geojson). Mapnik-omnivore can detect the filetype, layers, and other spatial info about a file. Therefore, TM2 no longer has to ask the user for certain information. This information is auto-populated into the proper modal and settings (for example: projection, maxzoom, and all layers are set automatically). Postgis and SQLite files are added the same as before, but they will hopefully be up to speed soon.

## UI Review:
I changed the `#addlayer` form a bit.

Before:
![screen shot 2014-06-05 at 6 45 48 pm](https://cloud.githubusercontent.com/assets/1209162/3194916/3be2aae6-ed05-11e3-8a02-434008220f55.png)

After:
![screen shot 2014-06-05 at 6 47 52 pm](https://cloud.githubusercontent.com/assets/1209162/3194918/423e17c2-ed05-11e3-8caa-470f6023ea21.png)

Now, once the file is selected:
- the UI will display the proper modal with projection and filepath
- if there are multiple layers in one file, the UI will display the main project modal (#) showing all layers
- the Fields modal will be populated
- you can zoom-to-layer using the crosshair icon next to the layer (local sources only). At the moment, layers that come from the same source will have the same lat/lon for zoom-to-layer since there is no way to retain each layer's center/extent (https://github.com/mapbox/tm2/issues/393)
- if the new source's maxzoom is greater than the project's current maxzoom, it favors the higher zoom (maxzoom for each new source is coming from `mapnik-omnivore`, which is set based on the size of the file)