tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 527 forks source link

keep application logic separate from mml #318

Closed springmeyer closed 13 years ago

springmeyer commented 13 years ago

The Carto MML files (mapnik markup language is where mml came from) in tilemill appear to contain a bunch of custom application logic for a given project including _center, _format, and _interactivity. Just got burned by this as it was not obvious that information like "key_name" for layer interactivity was being stored here.

Ideally we could find a logical, separate place for keeping this information unless the idea is to formally extend MML to support these things.

springmeyer commented 13 years ago

Just tested https://github.com/rundel/carto-parser with some tilemill maps, and it bails out on the properties that are not present in https://github.com/mapnik/reference.json. A good reminder that we need to either remove these or document them so people can properly implement carto apps.

d:carto-parser dane$ ./example ../tilemill_live/files/project/new/new.mml 
Error: Unknown keyword: _center at Line: 6 Col: 3
Error: Unknown keyword: _format at Line: 7 Col: 18
Error: Unknown keyword: _interactivity at Line: 8 Col: 25
Error: Unknown keyword: geometry at Line: 25 Col: 0
<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"/>
springmeyer commented 13 years ago

I see 'center', 'format', and interactivity stuff getting squared away in the separate https://github.com/mapbox/tilejson doc, which looks great.

'geometry' should be able to be reported dynamically by mapnik, so it seems like it should be removed.

/cc @rundel and @rcoup just so they are aware this is getting worked out.

yhahn commented 13 years ago

Let's discuss this in light of https://github.com/mapbox/tilelive-mapnik/issues/4 and come to some agreement on approach -- both carto parsers (js and C) should behave similarly when coming across MML properties that it does not recognize. At the moment js is ignoring unknown properties, allowing us to use MML as the vehicle for tilejson metadata as well.

springmeyer commented 13 years ago

Cool, C++ carto parser can ignore, or at least gracefully handle as well - ticket created for that https://github.com/rundel/carto-parser/issues/7.

yhahn commented 13 years ago

Great, closing.