Skip to content

Overlays support

Raul Ochoa edited this page Jun 12, 2015 · 1 revision

Goal

Support overlays like the ones you can create from the CartoDB editor (title, lon/lat annotation, anchored text item, anchored image) so it is possible to generate static images with them on top of the map.

Open questions

  • markdown or html support?
  • only available for static images?

Alternatives

HTML5 Canvas

  • basic font rendering + metrics
  • transpiler: markdown/html to components
  • plug it into coordinate system, cut for several tiles
  • hard to implement
  • easy to integrate as another renderer

Flipboard's canvas-react

  • text rendering supported, check how much of it
  • transpiler: markdown/html to components
  • probably a lot of issues with spacing and text metrics already solved
  • plug it into coordinate system, cut for several tiles
  • hard to implement
  • easy to integrate, it should be as it is still canvas

Mapnik font rendering

  • fake inline geojson data + font styling (so it does not require db conn)
  • limited in styling
  • no effort to integrate it in tiles
  • easy to integrate
  • easy to implement

Phanton JS

  • best rendering support, straight away: it's a headless webkit
  • plug it into coordinate system, cut for several tiles
  • probably it makes sense to be a separate service (not ideal) that only returns images for test+style, because I'm against introducing phantom overhead in windshaft
  • easy to implement
  • hard to integrate

Mapnik + Any canvas/image solution

  • leverage font rendering to a more powerful approach: like phantomjs
  • use mapnik to get images as marker files into the appropriate tiles
  • hard to implement, it requires implementing two components
  • hard to integrate, images must be managed/cached (integrate with grainstore?)

html2canvas

  • really difficult to run server side: no support for nodejs
  • easy to implement?
  • hard to integrate