gpt4 book ai didi

leaflet - 在LeafletJS中打印 map

转载 作者:行者123 更新时间:2023-12-02 05:19:59 24 4
gpt4 key购买 nike

我是 LeafletJS 的新手。我正在尝试在 LeafletJS 中打印 map 。我的打印代码是这样的:

     printProvider = L.print.provider({
capabilities: printConfig,
method: 'GET',
dpi: 254,
autoLoad: true,
// outputFormat: 'pdf',
customParams: {
mapTitle: 'Print Test',
comment: 'Testing Leaflet printing'
}
});
// Create a print control with the configured provider and add to the map
printControl = L.control.print({
provider: printProvider
});
map.addControl(printControl);

但是当我单击打印按钮时,错误如下所示

Proxy Error.
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /mapfish-print/pdf/print.pdf.

Reason: Error reading from remote server

有人可以帮助我吗?

最佳答案

您可以使用jQuery Plugin打印 map 。

代码很简单

$('#map').print();

这是codepen .

关于leaflet - 在LeafletJS中打印 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23322548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com