mapbox/tilemill — Issue #776: options passed to advanced mapnik options for layer are not preserved
Author: springmeyer
Created: 2011-10-10 19:10:43+00:00
State: open

This occurs if you use the special keyword of `type`.

For instance with the default project shapefile you can pass:

```
type="shape"
```

and the project continues working perfectly, but after saving the custom options string is not preserved.

The option is clearly being passed through to mapnik, as it should be, as `type="foo" will lead to an error like:

```
Error: Could not create datasource. No plugin found for type 'foo' (searched in: /usr/local/lib/mapnik2/input)
```

This ability to pass type is excellent - it means that the user can override the datasource plugin that mapnik uses for reading data. A developer usecase for this could be that a debug version of a plugin should be used (and has a different name), a more recent build should be used (https://github.com/springmeyer/sqlite3-mapnik), or a developer has written a new plugin for mapnik that TileMill does not know about and wants to read that data into TileMill.

It is this latter case where I noticed this problem, as I've written a new csv plugin (http://trac.mapnik.org/ticket/902) and was able to test it in TileMill with no code changes to TileMill simply by passing `type=csv`. However, the option is not preserved such that it must be set each time the layer is saved.