I have a question on the bounds of TileLayer.
I am fetching cropped tiles from a tile server and provide them to TileLayer's "data".
It works well and it shows my raster file well. However, when my viewpoint moves out of raster files' bounds,
it shows following error & webpage.
{"errorMessage": "Tile 11/1745/795 is outside image bounds"}
https://user-images.githubusercontent.com/70316208/101444110-211c1980-3962-11eb-9099-b5e46c45cec4.png
useEffect(() => {
fetch(endpoint + raster_path)
.then((res) => {
if (res.ok) return res.json();
// throw new Error("Network response was not ok.");
})
.then((data) => {
setTiles(data);
});
}, [raster_path]);
const tileLayer = new TileLayer({
data: [tiles.tiles + color],
maxRequests: 6,
pickable: true,
onViewportLoad: null,
autoHighlight: false,
highlightColor: [60, 60, 60, 40],
minZoom: 0,
maxZoom: 19,
tileSize: 512 / devicePixelRatio,
extent: [tiles.bounds],
maxCacheSize: 30,
renderSubLayers: (props) => {
const {
bbox: { west, south, east, north },
} = props.tile;
console.log(props);
return [
new BitmapLayer(props, {
data: null,
image: props.data,
bounds: [west, south, east, north],
}),
];
},
});
const layers = [
tileLayer,
];
return (
<div>
<DeckGL
initialViewState={viewport}
views={new MapView({ repeat: true })}
controller={true}
layers={[layers]}
onViewportChange={handleViewportChange}
>
<ReactMapGL
{...viewport}
width="100%"
height="100%"
onViewportChange={handleViewportChange}
mapboxApiAccessToken={process.env.REACT_APP_MAPBOX_TOKEN}
mapStyle="mapbox://styles/mapbox/streets-v9"
></ReactMapGL>
</DeckGL>
</div>
);
}
question from:
https://stackoverflow.com/questions/65897584/how-do-i-overlay-satellite-scene-data-on-basemap-in-deck-gl 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…