【background】
Openlayers is used in Vue to export the map as a picture. Originally, the map was loaded using the official method provided by openlayers, but the map was loaded too slowly. After changing to a sky map, the picture could not be exported and an error was reported.
【problem causes】
After using Tiandi, the cross-domain problem was not solved, so the image export failed
[Solution]
Add crossOrigin:'anonymous'
to deal with cross-domain issues
let tiandiditu = new Tile({
source: new XYZ({
crossOrigin:'anonymous',
url: '',
}),
});