Banner

Friday, 21 June 2013

Creating a synchronized view of two maps or images with Leaflet

In my last blog post, we created a Leaflet plugin capable of showing zoomable high-resolution images with Leaflet. Now, I need to compare two images side-by-side, and I've decided to create a generic plugin which can be used for maps as well.

The Leaflet.Sync plugin is just a few lines of code, but it took some time to figure out the inner workings of Leaflet. Here is a synchronized view of two maps of Foldøy island where I'm currently staying:

7 comments:

Anonymous
said...

Hi! Is it possible to create two synchronized maps but with different coordinates offset? I'm thinking of google maps example, where a small patch of the map is showing a synchronized view of the main map but with a different tile layer.