Monday, April 27, 2015

Raster Performance: OpenLayers vs. Leaflet

I'm starting to make general comparisons of the performance speed between Leaflet and OpenLayers for displaying raster data from my spatial data repository. The stack includes an ArcSDE 9.3.1 instance running on RHEL and Oracle 11g. I'm using Geoserver to hit the database and serve images as WMS requests. I've embedded two web pages here as iFrames for experimentation. Among many factors that can impact speed, embedding an API in a complex web mapping application can affect performance differently, especially when other APIs like jQuery are used in the same web space.

Leaflet:
OpenLayers

General Observations on the Two APIs


I've found Leaflet to be much easier to understand and use. It's a smaller, newer Javascript library and is more intuitive and user than OpenLayers, and I have been using OpenLayers for at least 5 years. OpenLayers is an excellent API for web mapping but I have found its syntax difficult to understand and follow. It's a very large API and implements a lot of heavy GIS functionality. That's great, but not always needed in fast web mapping scenarios. OpenLayers is not as intuitive to me, and it takes me longer to generate simple map examples in OpenLayers than it does with Leaflet, especially if I have multiple data formats and mixed projections.

iFrames created using iframe Generator Tool