[英]Telerik - ASP.Net MVC Map Control - Save As Image
I've a requirement to have a map control (with the addition of data plotting using bubbles, pins etc) to display in our website. 我需要有一个地图控件(添加使用气泡,大头针等绘制的数据)才能显示在我们的网站上。 The user should then have the ability to export this map as an image.
然后,用户应该能够将此地图导出为图像。
Does anyone know if that is possible? 有人知道这是否可能吗? I'm trying to use this control: http://www.telerik.com/aspnet-mvc/map with ASP.Net MVC5
我正在尝试使用此控件:带有ASP.Net MVC5的http://www.telerik.com/aspnet-mvc/map
If not, is there a method using other controls to do this? 如果不是,是否存在使用其他控件执行此操作的方法?
I have found below link which might helpful to you. 我发现以下链接可能对您有帮助。
Note: Please check your kendo ui version first. 注意:请先检查您的kendo ui版本。 Because all version don't provide this functionality.
因为所有版本都不提供此功能。
You can use the Kendo Drawing API for this. 您可以为此使用Kendo Drawing API。
This can be customized by changing the value in drawDOM to your own map's wrapper element. 可以通过将drawDOM中的值更改为自己的地图的wrapper元素来自定义。 Also, replace the proxyURL with your own as needed.
另外,根据需要用您自己的替换proxyURL。
// Convert the DOM element to a drawing using kendo.drawing.drawDOM
kendo.drawing.drawDOM($("#exampleWrap"))
.then(function(group) {
// Render the result as a PNG image
return kendo.drawing.exportImage(group);
})
.done(function(data) {
// Save the image file
kendo.saveAs({
dataURI: data,
fileName: "example.png",
proxyURL: "http://demos.telerik.com/kendo-ui/service/export"
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.