mapbox / carto

fast CSS-like map stylesheets
https://cartocss.readthedocs.io/
Apache License 2.0
652 stars 129 forks source link

Mapnik API documentation update #496

Closed kocio-pl closed 5 years ago

kocio-pl commented 6 years ago

There's another Mapnik APi documentation update, see https://github.com/mapbox/carto/issues/494#issuecomment-413976654. Please update CartoCSS code and NPM package to make text-offset and shield-offset options available.

nebulon42 commented 6 years ago

Since this is only a patch version update it is covered by the dependency expression which is ~8.9.1. So just do a npm install and you should have the newest mapnik-reference.

Side note: Please don't push out too many versions of mapnik-reference in a short time. I don't want to do a release every week just for mapnik-reference updates.

kocio-pl commented 6 years ago

Thanks. Just to be sure - I did it in Kosmtik and with text-offset: 10; it produces something like:

<TextSymbolizer fill="#845484" fontset-name="fontset-1" grid-cell-height="1" grid-cell-width="1" halo-fill="rgba(255, 255, 255, 0.6)" halo-radius="1.5" line-spacing="-0.6" margin="7.7" offset="10" placement="grid" repeat-distance="100000" size="11" wrap-width="50"><![CDATA[[name]]]></TextSymbolizer>

Was it really supposed to convert text-offset variable name into the offset? I ask because I don't see the labels shift at the first sight and grid options were not converted.

nebulon42 commented 6 years ago

Yes, as defined in e.g. https://github.com/mapnik/mapnik-reference/blob/gh-pages/3.0.20/reference.json#L2612. The css value is converted to the key of the object. The grid values stay prefixed in the definition.