简体   繁体   English

使用 PHP 或 Javascript 将 KML 文件转换为图像文件

[英]Convert a KML file to an image file using PHP or Javascript

I'm trying to convert a KML file with a lots of polygons into an image in order to put it into a PDF file with PHP.我正在尝试将包含大量多边形的 KML 文件转换为图像,以便使用 PHP 将其放入 PDF 文件中。 Is there any solution to achieve that ?有什么解决方案可以实现吗? I tried with Google Static Maps API but there are too much polygons.我尝试使用 Google Static Maps API,但多边形太多。 Thanks in advance.提前致谢。

It doesn't involve PHP, but you could load the KML file into Google Earth Pro, and use the "Save image" tool (or just a screenshot) to export an image version of the map with the KML polygons.它不涉及 PHP,但您可以将 KML 文件加载到 Google 地球专业版中,然后使用“保存图像”工具(或只是屏幕截图)导出带有 KML 多边形的地图图像版本。

If you don't want the map as the background, you can overlay a large filled polygon behind your KML polygons to give them a solid background color (white or otherwise).如果您不希望地图作为背景,您可以在 KML 多边形后面覆盖一个大的填充多边形,为它们提供纯色背景(白色或其他颜色)。 May have to play with Draw Order settings in the KMLs to get them to overlay in the desired order.可能需要使用 KML 中的绘制顺序设置来让它们以所需的顺序叠加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM