digidem / leaflet-side-by-side

A Leaflet control to add a split screen to compare two map overlays
http://lab.digital-democracy.org/leaflet-side-by-side/
MIT License
351 stars 111 forks source link

Support for vector tiles #7

Open cbeddow opened 8 years ago

cbeddow commented 8 years ago

I'm using a vector tile, but unfortunately can't get the slider to work the same on it as it would for a regular tile:

var config = {
    url: "http://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt"
    };
    var mapillarySource = new L.TileLayer.MVTSource(config);
    mapillarySource.setStyle(mlystyle);
    mapillarySource.addTo(map);

Then trying:

L.control.sideBySide(gsvLayer, mapillarySource).addTo(map);

But this works only for gsvLayer which is a normal L.TileLayer, while mapillarySource is displayed regardless of slider.

jordanharding commented 6 years ago

I assume this is why I'm getting this error?

image