Is it possible in Leaflet or OpenLayers to compare two maps with a bar to slide between the two?
I know it's possible, I don't know how to do it though. Anyone got any ideas? Examples?
What you want to do, is usually called a 'Swipe' tool.
There is no inbuilt tool or control for this in OpenLayers, but thankfully, there is an example here: Swipe Control with Google and OSM based on a custom class.
Most Swipe Tools/controls that I have seen online, are based on the simple CSS clip. It is very simple to integrate this kind of Control in your application even without external patches.
Mango does it with Leaflet. Check out an example here.
Of course you could just save the time to code it yourself and just create the map for free using Mango.
This is a working Leaflet example using two WMS layers and leaflet 0.5. It does need a bit of tweaking, for example the layers aren't clipped while panning. But it works pretty well.
Have a look at WMS Split for Leaflet.
it is possible with leaflet. here what I done the swipe map with leaflet and jquery.
I am using a nice Openlayers 3 and 4 extensions by viglino. You can find the examples of Swipe tool and Synchronized maps here.
Those examples are included in the GitHub repository.
Not the answer you're looking for? Browse other questions tagged openlayers-2 web-mapping leaflet swipe or ask your own question.
what is the basic programming language or code language for raster swipe tool?
Super large scale maps with Leaflet, how?
Making Story Map with two photos that can swipe?