The tile layer is used with the standalone adapter to add raster tile basemaps to visualizations.
This approach doesn't use any external dependencies or third-party basemap libraries. It only needs a connection to a tile server, which can also be hosted offline if required.
mapweave.addLayer(
new TileLayer({
data: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution:
'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a>',
},
}),
); const tileLayerOptions = {
attribution:
'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a>',
};
return (
<MapWeave>
<TileLayer
data="https://tile.openstreetmap.org/{z}/{x}/{y}.png"
options={tileLayerOptions}
></TileLayer>
</MapWeave>
); The tile layer supports raster tiles only.