5x12 pentomino tiling

Leaflet for a Tile Server


When we first started out serving map tiles then, like a lot of people, we used GeoServer. But GeoServer is a lumbering beast of a Java application which means running Tomcat on your server (and keeping an eye on it as it's not that stable). It's also pretty inefficient so you need to put GeoWebCache in front of it if you want to get vaguely reasonable performance without spending a fortune on server hardware.

So we slowly started moving away from this software stack. First we replaced GeoWebCache with squid as again it was more efficient and perfectly adequate for our needs.

Eventually however we got sufficiently frustrated with GeoServer that we came up with a plan and, with me providing the design and Beth providing the C programming skills, we came up with our own high performance tile server which we now use to serve the tiles for our map server. It's very fast and, because of the way we've designed it, we don't need a separate cache.

Unlike GeoServer, which will serve pretty much any map tiles on any projection with the right encouragement, this server was designed specifically for serving tiles created on the OSGB 36 aka EPSG:27700 datum which you may know better as the Ordnance Survey National Grid.

Now when we first developed it we were using the OpenLayers 2 JavaScript library, and indeed we still are, so it was designed work with that but since we have started selling our tile server service to other customers we've had requests to use our tile server with the Leaflet JavaScript library instead.

Leaflet logo If you've not come across it before Leaflet is an open-source JavaScript library for mobile-friendly interactive maps and it weighs in at just about 38KB of JavaScript compared to 723KB for OpenLayers 2.

That's pretty impressive but there is a catch to this of course: it's not as feature rich and flexible as OpenLayers. However it is simple to create applications in and, especially for mobile use where the mobile data speed may be slow and users are often paying by the byte, there's a strong case for using it when you can do without the extra power OpenLayers gives you.

With that in mind today we launched our extension to Leaflet which will allow customers to add tiles from our map server as a layer on their Leaflet map which will hopefully encourage some more people to join us merry band of map tile users.

Tags: linux, maps, work Written 13/02/17

Comment on this article

You can follow these posts on Twitter at @Wibblings
I am currently reading:

A Quite Impossible Proposal: How Not to Build a Railway by Andrew Drummond Snuff by Terry Pratchett

Word of the Day: