Tilemill layers and misc.

mlberg's Avatar

mlberg

15 Apr, 2011 03:11 AM

I've been admiring the 2010 Afgan election maps here:

http://2010.afghanistanelectiondata.org/maps

I had a few related questions.

For the chloropleth maps like the polling stations, you use a second layer of tiles to do the color shading and not via geojson in openlayers.

So relating to this:

  • I assume open layers makes it easy to serve up multiple tile layers? Do you have any docs or a blog post on how to do this?
  • Is there anywhere you can point to re: styling the second layers. The aliasing on the edges is beautiful and I'm wondering how you handle the opacity.
  • To do the color coding, do you just manually add data columns to the shape files in qgis or is there a way to assign these values dynamically?
  • Do you have any documentation yet on using tilelive.js to handle mouseovers? Is it ready to use or better to wait? I don't mind some loose edges :)
  • I realize going the tile layer approach looks MUCH nicer but it's also less dynamic. Do you have any general guidelines on when it makes sense to use the tile approach in terms of number of polys on a screen with openlayers? I realize polymaps uses SVG but do you think it's a good alternative?

Thanks for bearing with me. Really excited to figure this out!

Matt

  1. Support Staff 2 Posted by Will White on 16 Apr, 2011 03:13 PM

    Will White's Avatar

    Hi Matt,

    I assume open layers makes it easy to serve up multiple tile layers? Do you have any docs or a blog post on how to do this?

    OpenLayers can composite multiple tile layers together, but we are experimenting more with Modest Maps these days, which has a much simpler API. Modes Maps does not, however, support multiple layers out of the box, so lately we have been combining a baselayer and overlay into a single flattened tileset from TileMill.

    Is there anywhere you can point to re: styling the second layers. The aliasing on the edges is beautiful and I'm wondering how you handle the opacity.

    We don't have any docs about this specifically. TileMill should make the edges look smooth and allow you to do opacity. I can check with AJ to see if he has any tips.

    To do the color coding, do you just manually add data columns to the shape files in qgis or is there a way to assign these values dynamically?

    Yes, each polygon has a style applied based on a column in the shape file. There are several styles and each has a different color and applies to a different range of values.

    Do you have any documentation yet on using tilelive.js to handle mouseovers? Is it ready to use or better to wait? I don't mind some loose edges :)

    tilelive.js is nice because it allows you to render tiles with more dynamic data, but the documentation is a bit lacking right now. Are you set on using tilelive.js? If possible, I encourage you to try TileStream, which can serve interaction data out of an MBTiles file. You can create interactive tilesets with the dev version of TileMill on GitHub (access the options in the project settings), then export it as MBTiles. Copy it over to TileStream for hosting, and use the wax library to add the map to your application. There is some brand new documentation about using the wax library with Modest Maps.

    This documentation for the client side applies whether your using TileStream or tilelive.js to serve the interaction data.

    I realize going the tile layer approach looks MUCH nicer but it's also less dynamic. Do you have any general guidelines on when it makes sense to use the tile approach in terms of number of polys on a screen with openlayers? I realize polymaps uses SVG but do you think it's a good alternative?

    Polymaps isn't an option for us because we need good IE support. Polymaps also feels a little sluggish compared to Modest Maps. As for how many polygons you can have before switching to rasterized tiles, it all depends on the complexity of the polygons and your desire for speed. The browser is going to be sluggish even if you have a single sufficiently complex polygon. We currently use tiles for all polygons and do not render any in the browser, but our data has been static enough to allow for this.

  2. 3 Posted by mlberg on 16 Apr, 2011 08:34 PM

    mlberg's Avatar

    Will,

    Thank you very much. Very helpful. Have tilemill and tilestream working
    well. Will checkout wax shortly.

    Quick q - Is there currently a way you can generate a tileset from a command
    line? Once the .mml and .mss files are set? That would be extremely useful.

    Thanks again!

    Matt

    On Sat, Apr 16, 2011 at 11:13 AM, Will White <
    [email blocked]> wrote:

  3. Support Staff 4 Posted by Will White on 19 Apr, 2011 09:54 PM

    Will White's Avatar

    Hi Matt,
    It looks like AJ answered your command line question on this discussion. I'll close this.

    Thanks,
    Will

  4. Will White closed this discussion on 19 Apr, 2011 09:54 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

21 May, 2013 12:03 PM
21 May, 2013 11:36 AM
21 May, 2013 08:26 AM
21 May, 2013 09:53 AM
21 May, 2013 09:30 AM

 

21 May, 2013 09:00 AM
21 May, 2013 07:54 AM
21 May, 2013 07:36 AM