Simple Tiles tips

Friday, March 29, 2013

I’ve been experimenting with Propublica’s Simple Tiles, and I’ve run into some pitfalls. Starred entries are not in its documentation.

  1. *When doing queries on KML files, Simple Tiles or OGR takes the name of the layer from the tag. But for SHP files, it takes it from the first part of the file name. (Note that you can rename all the shapefile’s files and it will still work, but the name, save the extension, has to be the same for each file.)

  2. *If you add a simplet_map_set_slippy() call, make sure simplet_map_set_size() is called afterward, otherwise the map will be some fraction of the original size.

  3. Hex color strings are 9 characters: a ‘#,’ six hexadecimal digits specifying a color, and 2 hexadecimal digits specifying the alpha value. It will accept shorter strings and format them, but I’m unsure how it interprets them.

  4. *A misconfigured layer will prevent the layers after it from showing. I messed up a query on one of my layers, and it broke the one after it. If you have many layers, consider adding new ones to the end. That way the rest will stay intact.