kosmtik / kosmtik

Make maps with OpenStreetMap and Mapnik

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magnacarto plugin invalid project.mml.Stylesheet

Phyks opened this issue · comments

Hi,

When using the Magnacarto renderer in Kosmtik, this results in

[Core] Generating Mapnik XML…
[Core] Using mapnik version 3.1.0
[Core] Loading map…
[Core] Map ready
[Core] Loading map…
[Core] Map ready
[Core] Loading map…
[Core] Map ready
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1236:7)
    at Array.<anonymous> (/home/vagrant/kosmtik/src/back/ProjectServer.js:32:27)
    at Project.<anonymous> (/home/vagrant/kosmtik/src/back/StateBase.js:27:43)
    at Project.<anonymous> (/home/vagrant/kosmtik/src/back/StateBase.js:37:13)
    at done (/home/vagrant/kosmtik/node_modules/kosmtik-fetch-remote/index.js:31:23)
    at decr (/home/vagrant/kosmtik/node_modules/kosmtik-fetch-remote/index.js:26:17)
    at Project.FetchRemote.patchMML (/home/vagrant/kosmtik/node_modules/kosmtik-fetch-remote/index.js:84:5)
    at Project.<anonymous> (/home/vagrant/kosmtik/src/back/StateBase.js:35:74)
    at DataSourceLoader.patchMML (/home/vagrant/kosmtik/src/plugins/datasource-loader/index.js:51:15)

This is due to the plugin exporting the content of the Stylesheet instead of the path I think. Commenting https://github.com/kosmtik/kosmtik/blob/master/src/back/ProjectServer.js#L32 is a work around, but prevents having auto-reloading.

Thanks

I have a proposal for a fix of this issue in kosmtik/kosmtik-magnacarto#3.