简体   繁体   English

如何使用php将kml文件转换为图像?

[英]How do I convert a kml file into an image using php?

I need to be able to convert my kml files into an image so I can use them on a pdf I'm generating using mpdf. 我需要能够将我的kml文件转换为图像,以便可以在使用mpdf生成的pdf上使用它们。 I am currently using the javascript api to display the kml map on my webpages. 我目前正在使用JavaScript API在我的网页上显示kml地图。

From the Google Maps Image APIs: 通过Google Maps Image API:

The Google Maps Image APIs make it easy to embed a static Google Maps image or Street View panorama into your web page, with no need for JavaScript. Google Maps Image API使您可以轻松地将静态Google Maps图片或街景全景图嵌入到您的网页中,而无需使用JavaScript。

The APIs are as simple as constructing a URL with the information about your image; 这些API就像构造一个包含您的图像信息的URL一样简单; once the URL is loaded from an image tag, Google will create and return your map or Street View scene. 从图片标签加载网址后,Google会创建并返回您的地图或街景视图场景。

Then you can get an image instead of the javascript map with 然后,您可以获得一个图像而不是javascript地图

<img src="http://maps.googleapis.com/maps/api/staticmap?center=-15.800513,-47.91378&zoom=11&size=200x200">

Source 资源

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

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