0

CartoDB is working great for dynamic maps, but I have a use case to render a totally static map, just an image online. Google offers its static map api. Afaik there is no similar API for CartoDB. But does anyone have a work around that would let me display a single, non-zooming non-panning image?

It'd be ideal if I could just put it in an html img tag, but something with javascript could potentially work. It'd be ideal if it's lightweight, as many of these users have very slow connections.

1 Answer 1

2

The best available library is Mapshot. It even allows you to apply rendering effects to the static image,

https://github.com/javisantana/mapshot

See the example running live here,

http://bl.ocks.org/andrewxhill/8323177

Edit: There was an interesting project from Al Jazeera America that used CartoDB and stored static maps on request

http://ajamsessions.tumblr.com/post/66114088651/displaced-syrians-map

That project was built using PhantomJS to create and store the screenshot on the server, see,

http://phantomjs.org/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.