javascript - 将具有 WMS 图层的地图转换为图像并在 PDF 中使用它,但它适用于 WFS 图层
问题描述
我正在使用这种方法将包含 WMS 图层的地图转换为图像,然后在 PDF 中使用该图像。WFS 层一切正常,但 WMS 层不行。
function CaptureImage() {
map.once('postcompose', function(event) {
console.log(event);
var canvas = event.context.canvas;
console.log(canvas);
if (navigator.msSaveBlob) {
navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
} else {
canvas.toBlob(function(blob) {
var imgData = new Image();
imgData = canvas.toDataURL("png");
// Later I'm saving this image, but this is working for WFS, but not WMS Layers ;
});
}
});
}
解决方案
推荐阅读
- ios - 调用“停止”功能时,如何逐渐减慢计时器的速度?
- python - Django rest框架不正确的嵌套序列化
- marklogic - 不显示在 MarkLogic 上创建的集合以在 Geoserver 中创建图层
- reactjs - 如何在通用 React / React Native 项目中用玩笑收集覆盖率
- python - 如何查看 Kaggle 笔记本的内存使用情况?
- javascript - 如何使具有不同单词的多个数组在游戏屏幕上移动?
- amazon-web-services - 带有光线的 AWS SageMaker RL:ray.tune.error.TuneError:未指定可训练
- sql - 如何将 PARAMETERS 传递给 MS ACCESS 中的另一个查询(没有 VBA)?
- python - 相当具体的数据框查询
- sql - 如何从 SQL SERVER 中获得三班倒的总小时数?