I'm getting _maplibreGl.default.Compare
is not a constructor error always when I try to compare two maps.
part of code:
var beforeMap = L.maplibreGL({
container: "before",
style: "https://demotiles.maplibre.org/style.json",
center: [7.221275, 50.326111],
zoom: 5
}).addTo(mapRef.current);
var afterMap = L.maplibreGL({
container: "after",
style:
"https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte.vt/style.json",
center: [7.221275, 50.326111],
zoom: 5
}).addTo(mapRef.current);
// A selector or reference to HTML element
var container = "#comparison-container";
var map = new maplibregl.Compare(beforeMap, afterMap, container);
I'm using below versions:
"@maplibre/maplibre-gl-compare": "0.5.0",
"@maplibre/maplibre-gl-leaflet": "0.0.19",
"leaflet": "1.9.3",
"maplibre-gl": "1.15.3"
Any solution?
I'm expecting possible solution that related to the maplibre-gl
library.